DPDK patches and discussions
 help / color / mirror / Atom feed
From: Amit Prakash Shukla <amitprakashs@marvell.com>
To: Rasesh Mody <rmody@marvell.com>,
	Devendra Singh Rawat <dsinghrawat@marvell.com>
Cc: <dev@dpdk.org>, <jerinj@marvell.com>,
	Amit Prakash Shukla <amitprakashs@marvell.com>, <stable@dpdk.org>
Subject: [PATCH 2/3] net/qede/base: compilation fix for GCC-12
Date: Tue, 23 Aug 2022 16:27:41 +0530	[thread overview]
Message-ID: <20220823105742.2276506-2-amitprakashs@marvell.com> (raw)
In-Reply-To: <20220823105742.2276506-1-amitprakashs@marvell.com>

GCC 12 raises the following warning:

../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=array-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

Fixes: 3b307c55f2ac (net/qede/base: update FW to 8.40.25.0)
Cc: stable@dpdk.org

Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
---
 drivers/net/qede/base/ecore_init_fw_funcs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/qede/base/ecore_init_fw_funcs.c b/drivers/net/qede/base/ecore_init_fw_funcs.c
index 6a52f32cc9..4e4d1dc374 100644
--- a/drivers/net/qede/base/ecore_init_fw_funcs.c
+++ b/drivers/net/qede/base/ecore_init_fw_funcs.c
@@ -1416,7 +1416,7 @@ void ecore_init_brb_ram(struct ecore_hwfn *p_hwfn,
 		u32 i;						\
 		for (i = 0; i < (arr_size); i++)		\
 			ecore_wr(dev, ptt, ((addr) + (4 * i)),	\
-				 ((u32 *)&(arr))[i]);		\
+				 ((u32 *)(arr))[i]);		\
 	} while (0)
 
 #ifndef DWORDS_TO_BYTES
-- 
2.25.1


  reply	other threads:[~2022-08-23 10:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-23 10:57 [PATCH 1/3] net/i40e: " Amit Prakash Shukla
2022-08-23 10:57 ` Amit Prakash Shukla [this message]
2022-08-23 10:57 ` [PATCH 3/3] examples/ipsec-secgw: " Amit Prakash Shukla
2022-08-23 13:12   ` Akhil Goyal
2022-08-24 14:03 ` [PATCH 1/2] net/i40e: " Amit Prakash Shukla
2022-08-24 14:03   ` [PATCH 2/2] net/qede/base: " Amit Prakash Shukla
2022-10-06  9:52     ` Thomas Monjalon
2022-08-25  7:21   ` [PATCH 1/2] net/i40e: " Morten Brørup
2022-08-26  9:45   ` Amit Prakash Shukla
2022-08-26 10:32     ` Morten Brørup
2022-10-06  9:51   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220823105742.2276506-2-amitprakashs@marvell.com \
    --to=amitprakashs@marvell.com \
    --cc=dev@dpdk.org \
    --cc=dsinghrawat@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=rmody@marvell.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).