linux/drivers/soc/tegra/fuse
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
..
fuse-tegra20.c soc/tegra: Explicitly include correct DT includes 2023-07-21 17:12:19 +02:00
fuse-tegra30.c soc/tegra: Fix build failure on Tegra241 2024-02-01 16:03:18 +01:00
fuse-tegra.c mm/util: Swap kmemdup_array() arguments 2024-06-06 08:55:20 -07:00
fuse.h soc/tegra: fuse: Define tegra194_soc_attr_group for Tegra241 2024-02-01 15:58:05 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
speedo-tegra20.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201 2019-05-30 11:29:52 -07:00
speedo-tegra30.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201 2019-05-30 11:29:52 -07:00
speedo-tegra114.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201 2019-05-30 11:29:52 -07:00
speedo-tegra124.c soc: tegra: fuse: speedo-tegra124: Remove some set but unused variables 2020-11-10 20:40:49 +01:00
speedo-tegra210.c soc/tegra: fuse: Fix index bug in get_process_id 2020-11-19 11:43:49 +01:00
tegra-apbmisc.c soc/tegra: fuse: Add support for Tegra241 2024-02-01 15:58:05 +01:00