1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/soc/tegra
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
..
cbb soc/tegra: cbb: tegra194-cbb: Convert to platform remove callback returning void 2023-10-11 23:04:39 +02:00
fuse mm/util: Swap kmemdup_array() arguments 2024-06-06 08:55:20 -07:00
ari-tegra186.c soc/tegra: Add Tegra186 ARI driver 2021-10-08 21:42:38 +02:00
common.c soc/tegra: Migrate to dev_pm_opp_set_config() 2022-07-08 11:27:33 +05:30
flowctrl.c soc/tegra: flowctrl: Use devm_platform_get_and_ioremap_resource() 2023-04-05 14:59:09 +02:00
Kconfig soc/tegra: fuse: Add support for Tegra241 2024-02-01 15:58:05 +01:00
Makefile soc: tegra: Move powergate-bpmp driver to the genpd dir 2023-07-14 10:40:56 +02:00
pmc.c soc/tegra: pmc: Add EQOS wake event for Tegra194 and Tegra234 2024-04-26 17:36:10 +02:00
regulators-tegra20.c soc/tegra: regulators: Prepare for suspend 2021-12-16 14:03:38 +01:00
regulators-tegra30.c soc/tegra: regulators: Prepare for suspend 2021-12-16 14:03:38 +01:00