]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
soc: fsl: dpio: fix kcalloc() argument order
authorArnd Bergmann <arnd@arndb.de>
Fri, 9 Feb 2024 19:34:36 +0000 (20:34 +0100)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:20:08 +0000 (18:20 -0400)
commitfa92366e413fdb87379ebd0e11eae24259c68028
tree858e35c9f9e2b14a3cea7a7302fd33d0bf3c5fce
parent6915b1b28fe57e92c78e664366dc61c4f15ff03b
soc: fsl: dpio: fix kcalloc() argument order

[ Upstream commit 72ebb41b88f9d7c10c5e159e0507074af0a22fe2 ]

A previous bugfix added a call to kcalloc(), which starting in gcc-14
causes a harmless warning about the argument order:

drivers/soc/fsl/dpio/dpio-service.c: In function 'dpaa2_io_service_enqueue_multiple_desc_fq':
drivers/soc/fsl/dpio/dpio-service.c:526:29: error: 'kcalloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
  526 |         ed = kcalloc(sizeof(struct qbman_eq_desc), 32, GFP_KERNEL);
      |                             ^~~~~~
drivers/soc/fsl/dpio/dpio-service.c:526:29: note: earlier argument should specify number of elements, later size of each element

Since the two are only multiplied, the order does not change the
behavior, so just fix it now to shut up the compiler warning.

Dmity independently came up with the same fix.

Fixes: 5c4a5999b245 ("soc: fsl: dpio: avoid stack usage warning")
Reported-by: Dmitry Antipov <dmantipov@yandex.ru>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soc/fsl/dpio/dpio-service.c