Skip to content

Commit

Permalink
net/bnx2x: fix calloc parameters
Browse files Browse the repository at this point in the history
[ upstream commit ff0d80191617d3b4435e0f473b129cdc539c23f5 ]

gcc [1] generates warning [2] about rte_calloc usage, because
rte_calloc parameter order is wrong, fixing it by replacing parameters.

[1]
gcc (GCC) 14.0.1 20240124 (experimental)

[2]
Compiling C object drivers/libtmp_rte_net_bnx2x.a.p/net_bnx2x_bnx2x.c.o
../drivers/net/bnx2x/bnx2x.c: In function ‘bnx2x_alloc_ilt_lines_mem’:
../drivers/net/bnx2x/bnx2x.c:2392:44:
 warning: ‘rte_calloc’ sizes specified with ‘sizeof’ in the earlier
 argument and not in the later argument [-Wcalloc-transposed-args]
 2392 |                     sizeof(struct ilt_line), ILT_MAX_LINES,
      |                            ^~~~~~

Fixes: 540a211 ("bnx2x: driver core")

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
  • Loading branch information
ferruhy authored and bluca committed Mar 7, 2024
1 parent 3dba8ba commit 5cad6d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/bnx2x/bnx2x.c
Original file line number Diff line number Diff line change
Expand Up @@ -2389,7 +2389,7 @@ int bnx2x_alloc_ilt_mem(struct bnx2x_softc *sc)
static int bnx2x_alloc_ilt_lines_mem(struct bnx2x_softc *sc)
{
sc->ilt->lines = rte_calloc("",
sizeof(struct ilt_line), ILT_MAX_LINES,
ILT_MAX_LINES, sizeof(struct ilt_line),
RTE_CACHE_LINE_SIZE);
return sc->ilt->lines == NULL;
}
Expand Down

0 comments on commit 5cad6d4

Please sign in to comment.