projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3192f14
)
leds: ns2: Slightly simplify a memory allocation
author
Christophe JAILLET
<christophe.jaillet@wanadoo.fr>
Sat, 22 Jul 2023 20:26:49 +0000
(22:26 +0200)
committer
Lee Jones
<lee@kernel.org>
Fri, 28 Jul 2023 10:58:04 +0000
(11:58 +0100)
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>
drivers/leds/leds-ns2.c
patch
|
blob
|
history
diff --git
a/drivers/leds/leds-ns2.c
b/drivers/leds/leds-ns2.c
index 1677d66d8b0e349b79e5d8c4fbaaee855f62a3a1..f3010c472bbd4f95e51e02ad79da61dfa38318fb 100644
(file)
--- 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_k
zalloc(dev, array_size(sizeof(*leds), count
), GFP_KERNEL);
+ leds = devm_k
calloc(dev, count, sizeof(*leds
), GFP_KERNEL);
if (!leds)
return -ENOMEM;