linux/drivers/soc
Jean-Philippe Brucker 0ee1472547 mm/util: Swap kmemdup_array() arguments
GCC 14.1 complains about the argument usage of kmemdup_array():

  drivers/soc/tegra/fuse/fuse-tegra.c:130:65: error: 'kmemdup_array' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
    130 |         fuse->lookups = kmemdup_array(fuse->soc->lookups, sizeof(*fuse->lookups),
        |                                                                 ^
  drivers/soc/tegra/fuse/fuse-tegra.c:130:65: note: earlier argument should specify number of elements, later size of each element

The annotation introduced by commit 7d78a77733 ("string: Add
additional __realloc_size() annotations for "dup" helpers") lets the
compiler think that kmemdup_array() follows the same format as calloc(),
with the number of elements preceding the size of one element. So we
could simply swap the arguments to __realloc_size() to get rid of that
warning, but it seems cleaner to instead have kmemdup_array() follow the
same format as krealloc_array(), memdup_array_user(), calloc() etc.

Fixes: 7d78a77733 ("string: Add additional __realloc_size() annotations for "dup" helpers")
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240606144608.97817-2-jean-philippe@linaro.org
Signed-off-by: Kees Cook <kees@kernel.org>
2024-06-06 08:55:20 -07:00
..
amlogic
apple
aspeed
atmel
bcm
canaan soc: canaan: Deprecate SOC_CANAAN and use SOC_CANAAN_K210 for K210 2024-04-05 16:42:50 +01:00
dove
fsl Including fixes from CAN, netfilter, wireguard and IPsec. 2024-03-21 14:50:39 -07:00
fujitsu
gemini
hisilicon soc: hisilicon: kunpeng_hccs: replace MAILBOX dependency with PCC 2024-04-25 02:09:46 +00:00
imx
ixp4xx
lantiq
litex
loongson
mediatek soc: drivers for 6.10 2024-05-13 08:48:42 -07:00
microchip
nuvoton
pxa spi: pxa2xx: Use proper SSP header in soc/pxa/ssp.c 2024-03-25 00:49:17 +00:00
qcom tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
renesas soc: renesas: Enable TMU support on R-Car Gen2 2024-03-26 09:25:06 +01:00
rockchip
samsung soc: samsung: exynos-asv: Update Energy Model after adjusting voltage 2024-04-08 16:05:15 +02:00
sunxi
tegra mm/util: Swap kmemdup_array() arguments 2024-06-06 08:55:20 -07:00
ti soc: ti: wkup_m3_ipc: Send NULL dummy message instead of pointer message 2024-04-09 11:11:59 -05:00
ux500
versatile
xilinx
Kconfig
Makefile soc: canaan: Deprecate SOC_CANAAN and use SOC_CANAAN_K210 for K210 2024-04-05 16:42:50 +01:00