]> git.baikalelectronics.ru Git - kernel.git/commit
leds: gpio: Use struct_size() in devm_kzalloc()
authorGustavo A. R. Silva <gustavoars@kernel.org>
Fri, 19 Jun 2020 22:14:03 +0000 (17:14 -0500)
committerPavel Machek <pavel@ucw.cz>
Sun, 12 Jul 2020 08:28:01 +0000 (10:28 +0200)
commit687a0a7ad0c37c1a89a83bc6fc644f96b7e6d398
treeae676ad71662219e5e86ff5b1e5f64962084adba
parent2b17e2af92afbf3c328ab6b7021faf554744839e
leds: gpio: Use struct_size() in devm_kzalloc()

Make use of the struct_size() helper instead of an open-coded version
in order to avoid any potential type mistakes. Also, remove unnecessary
function sizeof_gpio_leds_priv().

This code was detected with the help of Coccinelle and, audited and
fixed manually.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
drivers/leds/leds-gpio.c