projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f0b0e92
)
pinctrl: lantiq: Use kasprintf() instead of fixed buffer formatting
author
Geert Uytterhoeven
<geert+renesas@glider.be>
Wed, 31 Jul 2019 13:29:16 +0000
(15:29 +0200)
committer
Linus Walleij
<linus.walleij@linaro.org>
Mon, 5 Aug 2019 11:30:15 +0000
(13:30 +0200)
Improve readability and maintainability by replacing a hardcoded string
allocation and formatting by the use of the kasprintf() helper.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link:
https://lore.kernel.org/r/20190731132917.17607-3-geert+renesas@glider.be
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-falcon.c
patch
|
blob
|
history
diff --git
a/drivers/pinctrl/pinctrl-falcon.c
b/drivers/pinctrl/pinctrl-falcon.c
index ef133a82e612544a9fbbf7e376085ee5d33db3f2..4a3b8d2677fd498feaa25011a25b663ab1fefb17 100644
(file)
--- a/
drivers/pinctrl/pinctrl-falcon.c
+++ b/
drivers/pinctrl/pinctrl-falcon.c
@@
-96,12
+96,8
@@
static void lantiq_load_pin_desc(struct pinctrl_pin_desc *d, int bank, int len)
int i;
for (i = 0; i < len; i++) {
- /* strlen("ioXYZ") + 1 = 6 */
- char *name = kzalloc(6, GFP_KERNEL);
-
- snprintf(name, 6, "io%d", base + i);
d[i].number = base + i;
- d[i].name =
name
;
+ d[i].name =
kasprintf(GFP_KERNEL, "io%d", base + i)
;
}
pad_count[bank] = len;
}