]> git.baikalelectronics.ru Git - kernel.git/commit
leds: ns2: Use struct_size() in devm_kzalloc()
authorGustavo A. R. Silva <gustavoars@kernel.org>
Wed, 17 Jun 2020 23:07:57 +0000 (18:07 -0500)
committerPavel Machek <pavel@ucw.cz>
Sun, 12 Jul 2020 08:26:10 +0000 (10:26 +0200)
commit2b17e2af92afbf3c328ab6b7021faf554744839e
treeb0169dface24e6e9648ae16139eb27927fffb7d5
parentab7d20a160fbadb6a314c7ed04e14f248b4c47e8
leds: ns2: 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_ns2_led_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-ns2.c