From nobody Tue Feb 10 19:00:19 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1684810169; cv=none; d=zohomail.com; s=zohoarc; b=Yo+U1sJ56gLiqVe8HhWEuc/yD3IEnd9FstvOECZHU8DZ68UM/nsnWAHPTELwkmMiB+03k9qq/NbxGoH2su0Y5HWgCBlLe19HHC+SWGK7Mg75FBHFBFJm89+17kd7OSS8Zmt1AW2DLO1EdVDfTjXRAXofnKPFyWYY9lfH5Px1hQI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684810169; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=LGnQE1ZhusP6AKK5Ux8Vrjgs1RYienY0y7ga8BQlUi8=; b=dN+CzdCiiZ22qfGDwM/n8EaSKC0Zrb/Ceo6oTd9uDOc+xAKJ1IKgfJV2KW33MremmjBfKfRONzfA0uYqfvwJowC1IcaIlWArjfiuot2NjNxkFdeHeTCxx1FzEsFeOERpTuR0Z7iOCAieGqzqFHb13K30KSTV5Jzz4mVRBiICimo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684810169918441.0293396836097; Mon, 22 May 2023 19:49:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1I1x-0006SC-E3; Mon, 22 May 2023 22:45:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1I1r-0006Be-3O for qemu-devel@nongnu.org; Mon, 22 May 2023 22:45:40 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1I1o-0004bY-Dz for qemu-devel@nongnu.org; Mon, 22 May 2023 22:45:38 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1ae4d1d35e6so48988385ad.0 for ; Mon, 22 May 2023 19:45:36 -0700 (PDT) Received: from alarm.. ([157.82.204.253]) by smtp.gmail.com with ESMTPSA id o10-20020a17090aac0a00b002467717fa60sm4769847pjq.16.2023.05.22.19.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 19:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1684809935; x=1687401935; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LGnQE1ZhusP6AKK5Ux8Vrjgs1RYienY0y7ga8BQlUi8=; b=t6wjEouC92UaRWuO0nmyN0zXZik7MYpJgqtQJ9zUJDLqss5rrkV6/EUPzPZFXh/ys7 VhqXAJYBFGnJ/HcCYKcY9meGpgxlazCxmb8naiNUlaU6BlCt0xy3Qvgs0XrC/rNBhZUc TObcFgDEAcQ6c0w7/cCXfhhu6M0ZfcmFyd9d9s0hlek4Q41ljN/ZrLIWiirQxN9gFuSZ txQzkTBHfKN52HO/WXyQVxCVoX25lResN5gq2QUsucELMX0hHU9UT+epkBelUhjRW7Oa 4WwVQpX6zFx4BPEOKq4kKoALOAtFrF4J4gbTL9Y3O5DpWkygLR4aIuguYleRYJueEoCH KeQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684809935; x=1687401935; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LGnQE1ZhusP6AKK5Ux8Vrjgs1RYienY0y7ga8BQlUi8=; b=eHBGAl6rulgxwDiyM8O8cpzXNriI7h3BsW72MUUXd1eirGBb+R9qRnL76/rWmITMqU s/agrQgMphukNv+1g4qa7hTSNKDtgch/2/cXVb0RkSrJqTCcPNXmHNILxseaySOrMPei /uD/ZqSe0pLnbMtEiZPIpZWZwaijMLg+yT+0QS6YXvXvp3BNeUUlhMYWsWBEkb1/SqSg ZOtIE2QIEGfadHMAJVYu0lrApVD7mx6kehIQTZ4N6wB7kUr8VuMV3XM4H2Isarr5VrZv YQl2CZjzH/pAfuzjT2w/IoUTvSFq4Jzfke7wbBglALNde384F7+jyFayrrx+p8sbqGe8 jLqQ== X-Gm-Message-State: AC+VfDyEJnb9mJwFlJu2aBXVieu9PCorFHcHuhp5jbRqNCC0uyUdIH1J en82+V7+RZ0qFnwdwHNuoDX+Sg== X-Google-Smtp-Source: ACHHUZ5gn4FWkgz/XDoJWaywmuU857I0vb8BGNrosX19KFf/YaBlhrEvOZBYJ34P9S3BZU4b8097DQ== X-Received: by 2002:a17:903:11c9:b0:1ac:63ac:10a7 with SMTP id q9-20020a17090311c900b001ac63ac10a7mr14749152plh.68.1684809935107; Mon, 22 May 2023 19:45:35 -0700 (PDT) From: Akihiko Odaki To: Cc: Sriram Yagnaraman , Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, Tomasz Dzieciol , Akihiko Odaki Subject: [PATCH v5 30/48] net/eth: Use void pointers Date: Tue, 23 May 2023 11:43:21 +0900 Message-Id: <20230523024339.50875-31-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230523024339.50875-1-akihiko.odaki@daynix.com> References: <20230523024339.50875-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::62e; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x62e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1684810171918100005 The uses of uint8_t pointers were misleading as they are never accessed as an array of octets and it even require more strict alignment to access as struct eth_header. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/net/eth.h | 4 ++-- net/eth.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/net/eth.h b/include/net/eth.h index 05f56931e7..95ff24d6b8 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -342,12 +342,12 @@ eth_get_pkt_tci(const void *p) =20 size_t eth_strip_vlan(const struct iovec *iov, int iovcnt, size_t iovoff, - uint8_t *new_ehdr_buf, + void *new_ehdr_buf, uint16_t *payload_offset, uint16_t *tci); =20 size_t eth_strip_vlan_ex(const struct iovec *iov, int iovcnt, size_t iovoff, - uint16_t vet, uint8_t *new_ehdr_buf, + uint16_t vet, void *new_ehdr_buf, uint16_t *payload_offset, uint16_t *tci); =20 uint16_t diff --git a/net/eth.c b/net/eth.c index b6ff89c460..f7ffbda600 100644 --- a/net/eth.c +++ b/net/eth.c @@ -226,11 +226,11 @@ void eth_get_protocols(const struct iovec *iov, size_= t iovcnt, size_t iovoff, =20 size_t eth_strip_vlan(const struct iovec *iov, int iovcnt, size_t iovoff, - uint8_t *new_ehdr_buf, + void *new_ehdr_buf, uint16_t *payload_offset, uint16_t *tci) { struct vlan_header vlan_hdr; - struct eth_header *new_ehdr =3D (struct eth_header *) new_ehdr_buf; + struct eth_header *new_ehdr =3D new_ehdr_buf; =20 size_t copied =3D iov_to_buf(iov, iovcnt, iovoff, new_ehdr, sizeof(*new_ehdr)); @@ -276,7 +276,7 @@ eth_strip_vlan(const struct iovec *iov, int iovcnt, siz= e_t iovoff, =20 size_t eth_strip_vlan_ex(const struct iovec *iov, int iovcnt, size_t iovoff, - uint16_t vet, uint8_t *new_ehdr_buf, + uint16_t vet, void *new_ehdr_buf, uint16_t *payload_offset, uint16_t *tci) { struct vlan_header vlan_hdr; --=20 2.40.1