mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-19 12:24:34 +08:00
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>
This commit is contained in:
parent
64c4dcbfcc
commit
f0b0e923e0
@ -228,10 +228,8 @@ int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev)
|
|||||||
* than dynamically allocate it and have to free it later,
|
* than dynamically allocate it and have to free it later,
|
||||||
* just point part way into the property name for the string.
|
* just point part way into the property name for the string.
|
||||||
*/
|
*/
|
||||||
if (ret < 0) {
|
if (ret < 0)
|
||||||
/* strlen("pinctrl-") == 8 */
|
statename = prop->name + strlen("pinctrl-");
|
||||||
statename = prop->name + 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* For every referenced pin configuration node in it */
|
/* For every referenced pin configuration node in it */
|
||||||
for (config = 0; config < size; config++) {
|
for (config = 0; config < size; config++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user