summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2023-07-22 23:26:49 +0300
committerLee Jones <lee@kernel.org>2023-07-28 13:58:04 +0300
commitc8a039436525072af7e77f540d21f0d312fc7c38 (patch)
treed247a47fe6578252aab31a99a4355ffe3fc6b1c7
parent3192f141240336dd6d7675ff374757006fed1916 (diff)
downloadlinux-c8a039436525072af7e77f540d21f0d312fc7c38.tar.xz
leds: ns2: Slightly simplify a memory allocation
Use devm_kcalloc() instead of devm_kzalloc()+array_size(). Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/560b8f140c19a7da40f5e9540c3ef312969b0dc4.1690057595.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones <lee@kernel.org>
-rw-r--r--drivers/leds/leds-ns2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c
index 1677d66d8b0e..f3010c472bbd 100644
--- a/drivers/leds/leds-ns2.c
+++ b/drivers/leds/leds-ns2.c
@@ -247,7 +247,7 @@ static int ns2_led_probe(struct platform_device *pdev)
if (!count)
return -ENODEV;
- leds = devm_kzalloc(dev, array_size(sizeof(*leds), count), GFP_KERNEL);
+ leds = devm_kcalloc(dev, count, sizeof(*leds), GFP_KERNEL);
if (!leds)
return -ENOMEM;