diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2019-07-31 09:29:15 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2019-08-05 07:29:29 -0400 |
commit | f0b0e923e07aa3efd3d5db0bd6ff421bd9a9a0d4 (patch) | |
tree | 0db183544fa9c2700a1eacb6d64d84f8d8447270 | |
parent | 64c4dcbfcc4ea3ae8f898e6dac836e57acb16b6b (diff) |
pinctrl: devicetree: Use strlen() instead of hardcoded number
Improve readability by replacing a hardcoded number requiring a comment
by strlen().
Gcc is smart enough to evaluate the length of a constant string at
compile-time.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20190731132917.17607-2-geert+renesas@glider.be
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/devicetree.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c index 88ddbb2e30de..5d6d8b1e9062 100644 --- a/drivers/pinctrl/devicetree.c +++ b/drivers/pinctrl/devicetree.c | |||
@@ -228,10 +228,8 @@ int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev) | |||
228 | * than dynamically allocate it and have to free it later, | 228 | * than dynamically allocate it and have to free it later, |
229 | * just point part way into the property name for the string. | 229 | * just point part way into the property name for the string. |
230 | */ | 230 | */ |
231 | if (ret < 0) { | 231 | if (ret < 0) |
232 | /* strlen("pinctrl-") == 8 */ | 232 | statename = prop->name + strlen("pinctrl-"); |
233 | statename = prop->name + 8; | ||
234 | } | ||
235 | 233 | ||
236 | /* For every referenced pin configuration node in it */ | 234 | /* For every referenced pin configuration node in it */ |
237 | for (config = 0; config < size; config++) { | 235 | for (config = 0; config < size; config++) { |