From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id EC5EEA00C4
	for <public@inbox.dpdk.org>; Thu,  6 Oct 2022 11:53:03 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id E84B742BEC;
	Thu,  6 Oct 2022 11:53:03 +0200 (CEST)
Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com
 [64.147.123.25])
 by mails.dpdk.org (Postfix) with ESMTP id 43E3D42BCC;
 Thu,  6 Oct 2022 11:53:01 +0200 (CEST)
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43])
 by mailout.west.internal (Postfix) with ESMTP id CFA21320090B;
 Thu,  6 Oct 2022 05:52:59 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute3.internal (MEProxy); Thu, 06 Oct 2022 05:53:00 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 cc:cc:content-transfer-encoding:content-type:date:date:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:sender:subject:subject:to:to; s=fm2; t=1665049979; x=
 1665136379; bh=MghP7nY2xbVMtF5fSpuw7bNPUlg8l+KXNsDLsrgcN5k=; b=s
 Tyw0jvuN71k3Ilmsqji7Gqvsgxj9cyxYNJ0/kLTPNRMhSuxB+VDg9w/K+nQSG4rZ
 FLFwu9MbzFvzSthNigArwxUqnFABogxj6B1VGc5Y06IR/cGCdIM4yt0SZa1t2JoD
 DgPZVRwjtcD7DXkcYEeVaX1klr7qOro0oci45nSaQ/8zXJBji0UHpspcj5Jk2KcT
 Btr04XTK7c/gvKLyvA2Jex36PMw7jwZbhvdIdMs5vKeg9Jv1mxVYE1/qDU3YAvG2
 I27yUy1I6Fk+PjURL/9dOipKDEzLOj52ulN+7RxyGY21Y5BIMixKyA+FvBwQtWIv
 aEeiN6FfI2NGBY14eAJkw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:date:date:feedback-id:feedback-id:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1665049979; x=
 1665136379; bh=MghP7nY2xbVMtF5fSpuw7bNPUlg8l+KXNsDLsrgcN5k=; b=h
 ayp/6nNx0/EZqviKzEcaC2J4vfRV8DKuWcEUwQAu94k2/Dp173uQnxxRDoTcvumL
 9XIHYZyyQpOx//mYSx0YkBwKjtwIhHa66pwWv49arNOw1/CBmvu4i91V18wSBSBb
 ALu+ypeAGGIJ8QrlSeH1vEM66BRGWGefxoIzF5mVHZX7pQgPHgXuTSx3cgA+sYif
 ux1lFhZskKFY6Cm3AOkV+o0iXO2egPpZOjGe9roYi1lOI9wyRN6LebnmSUG3ZapB
 vgYn7zM0L/oK0tIEjpgk/JLFjQHwbxkUAj/WQtPGuSOesczGC182E3srQ9nMkmJQ
 eBpzSO6LfiU0OIaMC6IFw==
X-ME-Sender: <xms:eqU-Y1gevXhT1rJpNKliti3DCXIXVsHQFCBpd5_ocLhJBKHE6snLjA>
 <xme:eqU-Y6AX3-LQ3nwuRZUF709vYO6E68u-mJwGaJlPccqFrAi4mneiZJrlU2QuBTnq_
 Cv-gjY14qXHiqnvFA>
X-ME-Received: <xmr:eqU-Y1EnF4ebbEdmJCvv3aqRxR5SF4htH8LNOz-AytYsdSNiAErtJXKTLxKIqMbrFPbXqR1JIQjkFaa0Y76M3z2KkQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeihedgvddtucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvvefufffkjghfggfgtgesthhqredttddtjeenucfhrhhomhepvfhhohhm
 rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc
 ggtffrrghtthgvrhhnpeegtddtleejjeegffekkeektdejvedtheevtdekiedvueeuvdei
 uddvleevjeeujeenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfh
 hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght
X-ME-Proxy: <xmx:e6U-Y6TvvROJltzin9npjb6SW-GHiXS-40zdhJRiU3vQ88fhQwPjcQ>
 <xmx:e6U-YywloGx76p6g3GNRknyRWRme2rh0KVBo_qUfeLE-Hca93aRmbQ>
 <xmx:e6U-Yw74Cw-wJWyocZzVXrXtzjIqGbei1ERCHIPB7XrKC_AHPiG5GQ>
 <xmx:e6U-Y8vFGtWXthnQumMeJfk7OfvTqYd45md96Oolk3tQoU9qe0HfZQ>
Feedback-ID: i47234305:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 6 Oct 2022 05:52:58 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: Amit Prakash Shukla <amitprakashs@marvell.com>
Cc: Rasesh Mody <rmody@marvell.com>,
 Devendra Singh Rawat <dsinghrawat@marvell.com>, stable@dpdk.org, dev@dpdk.org,
 jerinj@marvell.com
Subject: Re: [PATCH 2/2] net/qede/base: compilation fix for GCC-12
Date: Thu, 06 Oct 2022 11:52:56 +0200
Message-ID: <2528100.Lt9SDvczpP@thomas>
In-Reply-To: <20220824140339.2581716-2-amitprakashs@marvell.com>
References: <20220823105742.2276506-1-amitprakashs@marvell.com>
 <20220824140339.2581716-1-amitprakashs@marvell.com>
 <20220824140339.2581716-2-amitprakashs@marvell.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org

24/08/2022 16:03, Amit Prakash Shukla:
> GCC 12 raises the following warning:
>=20
> ../drivers/net/qede/base/ecore_init_fw_funcs.c: In function
> 'ecore_dmae_to_grc.constprop.isra':
> ../drivers/net/qede/base/ecore_init_fw_funcs.c:1418:25:
> 	error: array subscript 1 is outside array bounds of 'u32[1]'
> 	{aka 'unsigned int[1]'} [-Werror=3Darray-bounds]
>  1418 |                         ecore_wr(dev, ptt, ((addr) + (4 * i)),  \
>       |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  1419 |                                  ((u32 *)&(arr))[i]);           \
>       |                                  ~~~~~~~~~~~~~~~~~~~
> ../drivers/net/qede/base/ecore_init_fw_funcs.c:1465:17: note:
> 	in expansion of macro 'ARR_REG_WR'
>  1465 |            ARR_REG_WR(p_hwfn, p_ptt, addr, pData, len_in_dwords);
>       |            ^~~~~~~~~~
> ../drivers/net/qede/base/ecore_init_fw_funcs.c:1439:35:
> 	note: at offset 4 into object 'pData' of size 4
>  1439 |                              u32 *pData,
>       |                              ~~~~~^~~~~
> cc1: all warnings being treated as errors
>=20
> Fixes: 3b307c55f2ac (net/qede/base: update FW to 8.40.25.0)
> Cc: stable@dpdk.org
>=20
> Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>

Sorry I did not notice this patch and I recently submitted one
which I will abandon.
It seems there was no reply from qede maintainers after 6 weeks,
but I will apply anyway.

I will use my commit message:

    net/qede/base: fix 32-bit build with GCC 12
   =20
    A pointer is passed to a macro and it seems mistakenly referenced.
    This issue is seen only when compiling with GCC 12 for 32-bit:
   =20
    drivers/net/qede/base/ecore_init_fw_funcs.c:1418:25:
            error: array subscript 1 is outside array bounds of =E2=80=98u3=
2[1]=E2=80=99
            {aka =E2=80=98unsigned int[1]=E2=80=99} [-Werror=3Darray-bounds]
     1418 |                 ecore_wr(dev, ptt, ((addr) + (4 * i)),  \
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1419 |                          ((u32 *)&(arr))[i]);           \
          |                          ~~~~~~~~~~~~~~~~~~~
    drivers/net/qede/base/ecore_init_fw_funcs.c:1465:17:
            note: in expansion of macro =E2=80=98ARR_REG_WR=E2=80=99
     1465 |         ARR_REG_WR(p_hwfn, p_ptt, addr, pData, len_in_dwords);
          |         ^~~~~~~~~~
    drivers/net/qede/base/ecore_init_fw_funcs.c:1439:35:
            note: at offset 4 into object =E2=80=98pData=E2=80=99 of size 4
     1439 |                              u32 *pData,
          |                              ~~~~~^~~~~
   =20
    Fixes: 3b307c55f2ac ("net/qede/base: update FW to 8.40.25.0")
    Cc: stable@dpdk.org