[PATCH] riscv: unaligned: fix __setup handlers
Jisheng Zhang
jszhang at kernel.org
Wed Nov 11 20:22:03 PST 2026
On Wed, Nov 11, 2026 at 12:41:21PM +0200, Vladimir Kondratiev wrote:
> 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.
>
> Fixes: aecb09e091dc ("riscv: Add parameter for skipping access speed tests")
> Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev at mobileye.com>
Reviewed-by: Jisheng Zhang <jszhang at kernel.org>
> ---
> arch/riscv/kernel/unaligned_access_speed.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/riscv/kernel/unaligned_access_speed.c b/arch/riscv/kernel/unaligned_access_speed.c
> index 67f1a0371659..323ccfcfbbb7 100644
> --- a/arch/riscv/kernel/unaligned_access_speed.c
> +++ b/arch/riscv/kernel/unaligned_access_speed.c
> @@ -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,
> --
> Vladimir Kondratiev <vladimir.kondratiev at mobileye.com>
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
More information about the linux-riscv
mailing list