regmap: kunit: Use array_size() and sizeof(*ptr) consistently
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 6 Jun 2024 20:21:02 +0000 (23:21 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 7 Jun 2024 13:29:41 +0000 (14:29 +0100)
commitf82ecf76cdd477c64b09f328aaa182c1dc64dd8b
tree7bcfd04b1c87ec59aef21365e529b01ed6646904
parent0ae747759930186fbc3ab470ac4e40899c52438c
regmap: kunit: Use array_size() and sizeof(*ptr) consistently

Some of the allocations use explit sizeof(type) instead of sizeof(*ptr),
which is fragile. In particular, stress_insert() allocates double
of memory without obvious need for a test. Convert all allocations
to use array_size() and sizeof(*ptr) to eliminate similar mistakes
or wrong memory sizes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240606202102.3108729-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap-kunit.c