Skip to content

Commit

Permalink
net/qede/base: fix 32-bit build with GCC 12
Browse files Browse the repository at this point in the history
[ upstream commit acc0ed0 ]

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:

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,
      |                              ~~~~~^~~~~

Fixes: 3b307c5 ("net/qede/base: update FW to 8.40.25.0")

Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
  • Loading branch information
Amit Prakash Shukla authored and kevintraynor committed Oct 11, 2022
1 parent 9ba87ed commit 4d4b866
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/qede/base/ecore_init_fw_funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4d4b866

Please sign in to comment.