init/main: Use strtobool for param parsing in set_debug_rodata()
PATCH 1/1 init/main: Use strtobool for param parsing in set_debug_rodata()
Aftern parsing "full", we can still use strtobool rather than "on" and "off" parsing in set_debug_rodata().
--- init/main.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
init/main.c +1 -7
@@ -1463,13 +1463,7 @@ static int __init set_debug_rodata(char *str)if (arch_parse_debug_rodata (str))return 0 ; -if (str && !strcmp (str,"on" )) - rodata_enabled = true; -else if (str && !strcmp (str,"off" )) - rodata_enabled = false; -else -pr_warn ("Invalid option string for rodata: '%s'\n" , str); - return 0; + return strtobool(str, &rodata_enabled); }early_param ("rodata" , set_debug_rodata);#endif
Signature · 1 line
2.25.1
Quoted 4 lines · Tong Tiangen
Aftern parsing "full", we can still use strtobool rather than "on" and "off" parsing in
set_debug_rodata().Fixes 2e8cff0a0eee ("arm64: fix rodata=full")
Why do you think this is a fix; what do you believe is broken?
As noted in the commit message for 2e8cff0a0eee, we *deliberately* don't use strtobool() here so that we don't accept garbage values like "ful".
NAK to this patch as it stands.
Thanks,
Mark.
Quoted 27 lines
Signed-off-by Tong Tiangen <[email protected]>--- init/main.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)init/main.c +1
-7@@ -1463,13 +1463,7 @@ static int __init set_debug_rodata(char *str)if (arch_parse_debug_rodata (str))return 0 ; -if (str && !strcmp (str,"on" )) - rodata_enabled = true; -else if (str && !strcmp (str,"off" )) - rodata_enabled = false; -else -pr_warn ("Invalid option string for rodata: '%s'\n" , str); - return 0; + return strtobool(str, &rodata_enabled); }early_param ("rodata" , set_debug_rodata);#endif Signature · 1 line
2.25.1
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 8 lines · Mark Rutland
Quoted 4 lines · Tong Tiangen
Aftern parsing "full", we can still use strtobool rather than "on" and "off" parsing in
set_debug_rodata().Fixes 2e8cff0a0eee ("arm64: fix rodata=full")Why do you think this is a fix; what do you believe is broken?
Quoted 7 lines
As noted in the commit message for
2e8cff0a0eee, we *deliberately* don't usestrtobool()here so that we don't accept garbage values like "ful".NAK to this patch as it stands.
Thanks,
Mark.
Hi Mark:
Ok, missing that.
Thanks,
Tong.
Quoted 30 lines
Quoted 28 lines
Signed-off-by Tong Tiangen <[email protected]>--- init/main.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)init/main.c +1
-7@@ -1463,13 +1463,7 @@ static int __init set_debug_rodata(char *str)if (arch_parse_debug_rodata (str))return 0 ; -if (str && !strcmp (str,"on" )) - rodata_enabled = true; -else if (str && !strcmp (str,"off" )) - rodata_enabled = false; -else -pr_warn ("Invalid option string for rodata: '%s'\n" , str); - return 0; + return strtobool(str, &rodata_enabled); }early_param ("rodata" , set_debug_rodata);#endif Signature · 1 line
2.25.1.