linux/drivers/base/regmap
Dmitry Antipov 3b201c9af7
regmap: fix kcalloc() arguments order
When compiling with gcc version 14.0.0 20231220 (experimental)
and W=1, I've noticed a bunch of four similar warnings like:

drivers/base/regmap/regmap-ram.c: In function '__regmap_init_ram':
drivers/base/regmap/regmap-ram.c:68:37: warning: 'kcalloc' sizes specified with
'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
   68 |         data->read = kcalloc(sizeof(bool), config->max_register + 1,
      |                                     ^~~~

Since 'n' and 'size' arguments of 'kcalloc()' are multiplied to
calculate the final size, their actual order doesn't affect the
result and so this is not a bug. But it's still worth to fix it.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Link: https://msgid.link/r/20231220175829.533700-1-dmantipov@yandex.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-20 18:11:38 +00:00
..
internal.h regmap: ram: support noinc semantics 2023-11-13 01:26:17 +00:00
Kconfig regmap: Provide user selectable option to enable regmap 2023-07-13 16:20:28 +01:00
Makefile regmap: Provide a ram backed regmap with raw support 2023-06-12 14:47:54 +01:00
regcache-flat.c
regcache-maple.c regmap: maple: Use alloc_flags for memory allocations 2023-07-20 20:37:39 +01:00
regcache-rbtree.c regmap: rbtree: Fix wrong register marked as in-cache when creating new node 2023-09-22 16:54:00 +01:00
regcache.c regmap: Ensure range selector registers are updated after cache sync 2023-10-26 16:54:05 +01:00
regmap-ac97.c
regmap-debugfs.c regmap: debugfs: Fix a erroneous check after snprintf() 2023-09-11 01:30:07 +01:00
regmap-fsi.c regmap: Add FSI bus support 2022-11-25 19:17:02 +00:00
regmap-i2c.c regmap: Account for register length in SMBus I/O limits 2023-07-17 06:15:15 +01:00
regmap-i3c.c
regmap-irq.c regmap-irq: Fix out-of-bounds access when allocating config buffers 2023-07-12 12:05:10 +01:00
regmap-kunit.c regmap: kunit: add noinc write test 2023-11-13 01:26:18 +00:00
regmap-mdio.c regmap: Rework regmap_mdio_c45_{read|write} for new C45 API. 2023-01-16 13:16:09 +00:00
regmap-mmio.c regmap: mmio: Remove unused 64-bit support code 2023-07-09 22:48:46 +01:00
regmap-ram.c regmap: fix kcalloc() arguments order 2023-12-20 18:11:38 +00:00
regmap-raw-ram.c regmap: fix kcalloc() arguments order 2023-12-20 18:11:38 +00:00
regmap-sccb.c
regmap-sdw-mbq.c
regmap-sdw.c regmap: sdw: check for invalid multi-register writes config 2023-05-24 11:21:51 +01:00
regmap-slimbus.c
regmap-spi-avmm.c regmap: Drop initial version of maximum transfer length fixes 2023-07-17 06:15:14 +01:00
regmap-spi.c regmap: spi: Reserve space for register address/padding 2022-08-18 15:02:05 +01:00
regmap-spmi.c
regmap-w1.c
regmap.c regmap: fix regmap_noinc_write() description 2023-11-21 23:20:39 +00:00
trace.h regmap: trace: Remove unneeded blank lines 2022-09-05 13:09:45 +01:00