]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mfd: sec-common: Use sizeof(*var), not sizeof(struct type_of_var)
authorAndré Draszik <andre.draszik@linaro.org>
Wed, 9 Apr 2025 20:37:41 +0000 (21:37 +0100)
committerLee Jones <lee@kernel.org>
Fri, 23 May 2025 07:48:47 +0000 (08:48 +0100)
commit2b897a1c2b667fce1fd9dcf318dbab5992c3e506
tree16a38e33d8c68340ece7e7cc4ea1a7e79d167f92
parent856c6514d5ab491a5ad4be6e797d0d5283ad51aa
mfd: sec-common: Use sizeof(*var), not sizeof(struct type_of_var)

Using sizeof(*var) is generally preferred over using the size of its
open-coded type when allocating memory.

This helps avoiding bugs when the variable type changes but the memory
allocation isn't updated, and it simplifies renaming of the struct if
ever necessary.

No functional change.

Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://lore.kernel.org/r/20250409-s2mpg10-v4-20-d66d5f39b6bf@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/sec-common.c