diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2019-07-31 15:29:16 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2019-08-05 13:30:15 +0200 |
commit | 811604d01e1a98a5cfdebde211f20368d151fcd4 (patch) | |
tree | 9988fc5e722c47a3f23a6a3df43547bc64e7201c /drivers/pinctrl | |
parent | f0b0e923e07aa3efd3d5db0bd6ff421bd9a9a0d4 (diff) | |
download | linux-stable-811604d01e1a98a5cfdebde211f20368d151fcd4.tar.gz linux-stable-811604d01e1a98a5cfdebde211f20368d151fcd4.tar.bz2 linux-stable-811604d01e1a98a5cfdebde211f20368d151fcd4.zip |
pinctrl: lantiq: Use kasprintf() instead of fixed buffer formatting
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>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/pinctrl-falcon.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/pinctrl/pinctrl-falcon.c b/drivers/pinctrl/pinctrl-falcon.c index ef133a82e612..4a3b8d2677fd 100644 --- 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; } |