From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5C45BA0C4A for ; Tue, 13 Jul 2021 09:44:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D1FA411DA; Tue, 13 Jul 2021 09:44:02 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id B7C3E4069E; Tue, 13 Jul 2021 09:44:00 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5DE615C0103; Tue, 13 Jul 2021 03:43:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 13 Jul 2021 03:43:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= 6MAOBEkQSQFKRedjHUP4qBtvdHMAa0XLd3enX5/dfXA=; b=BcDWJN58ApN/8LE5 1/D6jnZ7DxOwQdPpYV9gy1+/4oD0mWOrG6x3F2lw/xyy+ryRq3ehh0Ioy8OX6L9M rXASmZMCYV5KVy8wVvYI5v4Zq0FGvt0stSmd0zVuN1bXj3b1UBysgDWku2WSbm14 ysBquR1RRBiShB2Tcw3QGKnQY/004V1umqbW5p4Ku69VDVt2LkTJMSycY4IjgyNG Gnmrc14KW6AB5sZQnrE9ImSAN4ChT7lEzQ89PdiGGI1IgYkhczLSJ9GYND0gIh4Q yuRNvl3h6c6w5x3lJOYX+VUbRu0m4dH6pTn3WVmKdnuTl5a0p9jQ34JM2pGJOVYW xli/xw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=6MAOBEkQSQFKRedjHUP4qBtvdHMAa0XLd3enX5/df XA=; b=Q/osEu62WAs3HWPfZ8ijT5r6BnLpXJfqOpTxXEnSJujH+IRNbo4LNPdjd rmQ87dwfUYqCS2C2M5Qv1C1PgjMbtbw7u69VnFFYa1/4y4H8To6nVG7Eb4F/zrbh VbDU3zcly5YoQj+2Xp1XWzs/2uVpzQGl/MsrAukBKtCJl+ZiIJxtLY+pCfJnx5iy k5LqW7bWTEl0UZZFJBkLlHSTWRWVoeEkFYrqytDPQ4qCi5/7sRCnH1UFlNGGGSG0 V1N5Jnb9VcW7gR9VqAqQYq5EGlTgJcdzPdlr1PSZksr2riAB6uXGeDnKTyvLWLdz bYKMAs0I9/6N1/BY+OnHHn22906MA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeggdeklecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Jul 2021 03:43:55 -0400 (EDT) From: Thomas Monjalon To: Eli Britstein Cc: dev@dpdk.org, Ilya Maximets , Gaetan Rivet , Majd Dibbiny , Asaf Penso , Harry Van Haaren , stable@dpdk.org, olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru Date: Tue, 13 Jul 2021 09:43:57 +0200 Message-ID: <4929759.u37M3IBpAE@thomas> In-Reply-To: <20210713064910.12793-3-elibr@nvidia.com> References: <20210713064910.12793-1-elibr@nvidia.com> <20210713064910.12793-3-elibr@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-stable] [PATCH 2/3] mbuf: avoid cast-align warning in pktmbuf mtod offset macro X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" +Cc mbuf maintainers Please use --cc-cmd devtools/get-maintainer.sh to make it automatic. 13/07/2021 08:49, Eli Britstein: > In rte_pktmbuf_mtod_offset macro, there is a casting from char * to type > 't', which may cause cast-align warning when using gcc flags > '-Werror -Wcast-align': > > .../include/rte_mbuf_core.h:723:3: error: cast increases required alignment > of target type [-Werror=cast-align] > 723 | ((t)((char *)(m)->buf_addr + (m)->data_off + (o))) > | ^ > > As the code assumes correct alignment, add first a (void *) casting, to > avoid the warning. > > Fixes: af75078fece3 ("first public release") > Cc: stable@dpdk.org > > Signed-off-by: Eli Britstein > --- > lib/mbuf/rte_mbuf_core.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h > index bb38d7f581..dabdeee604 100644 > --- a/lib/mbuf/rte_mbuf_core.h > +++ b/lib/mbuf/rte_mbuf_core.h > @@ -720,7 +720,7 @@ struct rte_mbuf_ext_shared_info { > * The type to cast the result into. > */ > #define rte_pktmbuf_mtod_offset(m, t, o) \ > - ((t)((char *)(m)->buf_addr + (m)->data_off + (o))) > + ((t)(void *)((char *)(m)->buf_addr + (m)->data_off + (o))) > > /** > * A macro that points to the start of the data in the mbuf. >