Commit f82ecf7
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>1 parent 0ae7477 commit f82ecf7
1 file changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
768 | 768 | | |
769 | 769 | | |
770 | 770 | | |
771 | | - | |
772 | | - | |
| 771 | + | |
| 772 | + | |
773 | 773 | | |
774 | | - | |
775 | 774 | | |
776 | 775 | | |
777 | 776 | | |
| |||
1507 | 1506 | | |
1508 | 1507 | | |
1509 | 1508 | | |
1510 | | - | |
1511 | 1509 | | |
1512 | 1510 | | |
| 1511 | + | |
1513 | 1512 | | |
1514 | 1513 | | |
1515 | 1514 | | |
1516 | 1515 | | |
1517 | 1516 | | |
1518 | 1517 | | |
| 1518 | + | |
1519 | 1519 | | |
1520 | 1520 | | |
1521 | 1521 | | |
| |||
1615 | 1615 | | |
1616 | 1616 | | |
1617 | 1617 | | |
1618 | | - | |
| 1618 | + | |
1619 | 1619 | | |
1620 | 1620 | | |
1621 | 1621 | | |
| |||
0 commit comments