riscv: unaligned: fix __setup handlers
PATCH 1/1 riscv: unaligned: fix __setup handlers
Returning -EINVAL from a __setup() callback cause invalid unaligned_scalar_speed= and unaligned_vector_speed=
values to be treated as handled. obsolete_checksetup() treats any non-zero return value from setup_func() as success, so an unrecognized argument is silently accepted instead of being reported as an unknown boot option.
__setup() handlers return 0 on failure.
--- arch/riscv/kernel/unaligned_access_speed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/kernel/unaligned_access_speed.c +2 -2
@@ -322,7 +322,7 @@ static int __init set_unaligned_scalar_speed_param(char *str)else if (!strcmp (str, speed_str[RISCV_HWPROBE_MISALIGNED_SCALAR_UNSUPPORTED ])) unaligned_scalar_speed_param =RISCV_HWPROBE_MISALIGNED_SCALAR_UNSUPPORTED ;else -return -EINVAL ; +return 0 ;return 1 ; }
@@ -337,7 +337,7 @@ static int __init set_unaligned_vector_speed_param(char *str)else if (!strcmp (str, speed_str[RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED ])) unaligned_vector_speed_param =RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED ;else -return -EINVAL ; +return 0 ;return 1 ; }
---
base-commit: c03c1a14507dfaf8b856c2608f9ac216021fc222
change-id: 20261111-fix-riscv-unaligned-e2df80509e0f
Best regards,
Signature · 1 line
Vladimir Kondratiev <[email protected]>
Quoted 11 lines · Vladimir Kondratiev
Returning
-EINVALfrom a__setup()callback cause invalid unaligned_scalar_speed= and unaligned_vector_speed=
values to be treated as handled.obsolete_checksetup()treats any non-zero return value fromsetup_func()as success, so an unrecognized argument is silently accepted instead of being reported as an unknown boot option.
__setup()handlers return 0 on failure.Fixes aecb09e091dc ("riscv: Add parameter for skipping access speed tests")Signed-off-by Vladimir Kondratiev <[email protected]>
Quoted 40 lines
--- arch/riscv/kernel/unaligned_access_speed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/riscv/kernel/unaligned_access_speed.c +2
-3@@ -322,7 +322,7 @@ static int __init set_unaligned_scalar_speed_param(char *str)else if (!strcmp (str, speed_str[RISCV_HWPROBE_MISALIGNED_SCALAR_UNSUPPORTED ])) unaligned_scalar_speed_param =RISCV_HWPROBE_MISALIGNED_SCALAR_UNSUPPORTED ;else -return -EINVAL ; +return 0 ;return 1 ; }@@ -337,7 +337,7 @@ static int __init set_unaligned_vector_speed_param(char *str)else if (!strcmp (str, speed_str[RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED ])) unaligned_vector_speed_param =RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED ;else -return -EINVAL ; +return 0 ;return 1 ; } ---base-commit:
c03c1a14507dfaf8b856c2608f9ac216021fc222
change-id: 20261111-fix-riscv-unaligned-e2df80509e0fBest regards,
Signature · 7 lines
Vladimir Kondratiev <[email protected]> _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Paul Walmsley
maintainerQuoted 11 lines · Vladimir Kondratiev
Returning
-EINVALfrom a__setup()callback cause invalid unaligned_scalar_speed= and unaligned_vector_speed=
values to be treated as handled.obsolete_checksetup()treats any non-zero return value fromsetup_func()as success, so an unrecognized argument is silently accepted instead of being reported as an unknown boot option.
__setup()handlers return 0 on failure.Fixes aecb09e091dc ("riscv: Add parameter for skipping access speed tests")Signed-off-by Vladimir Kondratiev <[email protected]>
Thanks, queued for v7.4-rc with a stable@ cc.
- Paul