From nobody Wed Feb 11 00:55:43 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=1682505676; cv=none; d=zohomail.com; s=zohoarc; b=PKk50pWLs0qBTKNAGTAu9fyEB7uNZmv70yM350ePUPGl0oGJLQdeJS9ZvFqMLCTPKTgZvDkp48VSfQa1mOH32cB+t5pDqGLtSTdIZ9EAQUDyC8VGGsfwpQZi+ksrmnQU8TibgrpJWKBdYncQ4mRrYzhQJ8ofW6lls+zvkxtTeEA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682505676; 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=oSx/Q5Zg5D9OUWDD4DVLGcD91xlqvbaERviIetrBRHM=; b=mED+eT6AI3Z/eMiChrgoZlrL24J8i2WJWORhBfYVYv9JNxr5/bbTRMF4QIMZW4lO5N82tXX7HjiXxdn30fYL88K95ir76lCw38CMhtZRQGKrW5xa80ctVk1wMtMhjLHK3nDDSHe0/XSSYSDVS488ypDiI4+RtTR8UQ+cuCwV1a0= 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 1682505676399265.43191989019624; Wed, 26 Apr 2023 03:41:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prcYM-0004It-3M; Wed, 26 Apr 2023 06:39:14 -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 1prcYK-0004Gj-EU for qemu-devel@nongnu.org; Wed, 26 Apr 2023 06:39:12 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1prcYI-0003JH-UN for qemu-devel@nongnu.org; Wed, 26 Apr 2023 06:39:12 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-63b70f0b320so8917152b3a.1 for ; Wed, 26 Apr 2023 03:39:10 -0700 (PDT) Received: from alarm.u-tokyo.ac.jp ([157.82.194.15]) by smtp.gmail.com with ESMTPSA id m11-20020a63580b000000b0051322a5aa64sm9317919pgb.3.2023.04.26.03.39.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 03:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1682505550; x=1685097550; 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=oSx/Q5Zg5D9OUWDD4DVLGcD91xlqvbaERviIetrBRHM=; b=lMXiM2TUCBS/bG+Gnimp14vHsfPrjEz3VLhwSjtYTIgA+K3BFKrVHlcOHNGk5/oJlP z4Ei12DVg0sSMUCePBPeT6yLreLZbN+bmychV8rYGuFIj/XE1YtvB5ryM7d3QI4cELzv Ca9M5QpY82uhJgT91YPXULaOG9KQ4iiXs4MmJ0+8va+8GVyyshex7ikvD9WRwI3sfOWi poOdUFhTQoBCcTZfHE1PImOH95ETZWdNMwGKC0vP4jYpDl2+qUL4aOwGQhbytql3Pijq lx3EEt123KK2SVWiMRVd9+RdpJGZF3u7y7pmBH7VgTZBvBKS25agFpxJYZ3iyk7CGQNM UYgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682505550; x=1685097550; 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=oSx/Q5Zg5D9OUWDD4DVLGcD91xlqvbaERviIetrBRHM=; b=edqzwlevxMlCvLYhXy7cmhA0RXhbzea9u9o0wE/QWenWY796cMclmlNX73AB8RmHEj G1dGk5cdAi+BkV/yLTlPIgEUFvbj1gyegpY2Div4vHBTm6K0YhwxtH4wz7s+vqWFIsik u50TtWDKPyAz4ARuJlZQ6al6ge3LfZY0JT5qcPBo5mv7HtNzetfy1NTjK3X4LpUVfNJt I7MpH3cAxOZ4fJpzmYcZ3RgbiLnUSwJPhUB+4z5sMGDb3IbeElwPtScXh5K1JOciSAYn GgxRprZTVbrNEDv/FGdicPm81RWBNLySm0sK3KYrs+xRj4ouYzMOySbovkDKJwX1TTMF Xh2Q== X-Gm-Message-State: AAQBX9eUXMsvJyqM6XfoKi9Hev2KmEZ+/PBuBPEmRuxgH3EYVLdHZZW1 RVrGbQO8LhFnHKMuGvxqeU4jJQ== X-Google-Smtp-Source: AKy350YZgyzvuYkRQhMY5TpVs0GFwknaLEonEbXNV7iRWIb/VD7jBqHnpmYPdQGROHjFNqURGdpz+Q== X-Received: by 2002:a05:6a21:789b:b0:f5:b78b:1a0e with SMTP id bf27-20020a056a21789b00b000f5b78b1a0emr10456509pzc.9.1682505549736; Wed, 26 Apr 2023 03:39:09 -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 v4 30/48] net/eth: Use void pointers Date: Wed, 26 Apr 2023 19:36:58 +0900 Message-Id: <20230426103716.26279-31-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230426103716.26279-1-akihiko.odaki@daynix.com> References: <20230426103716.26279-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::42e; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x42e.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: 1682505677753100001 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.0