projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
83a9886
)
pwm: Use kcalloc() instead of kzalloc()
author
Thierry Reding
<thierry.reding@gmail.com>
Mon, 2 May 2016 10:07:34 +0000
(12:07 +0200)
committer
Thierry Reding
<thierry.reding@gmail.com>
Tue, 3 May 2016 11:57:05 +0000
(13:57 +0200)
kcalloc() should be preferred for allocations of arrays over kzalloc()
with multiplication.
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/core.c
patch
|
blob
|
history
diff --git
a/drivers/pwm/core.c
b/drivers/pwm/core.c
index
bc0c20a
..
2a1a2d5
100644
(file)
--- a/
drivers/pwm/core.c
+++ b/
drivers/pwm/core.c
@@
-255,7
+255,7
@@
int pwmchip_add_with_polarity(struct pwm_chip *chip,
if (ret < 0)
goto out;
- chip->pwms = k
zalloc(chip->npwm *
sizeof(*pwm), GFP_KERNEL);
+ chip->pwms = k
calloc(chip->npwm,
sizeof(*pwm), GFP_KERNEL);
if (!chip->pwms) {
ret = -ENOMEM;
goto out;