Skip to contentSkip to conversation

riscv: unaligned: fix __setup handlers

PATCH In review Vladimir Kondratiev 3 participants 3 messages Nov 11 – Nov 18 RISC-V

lore
Share & tools
lore
#0 lore raw

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.

Fixes aecb09e091dc ("riscv: Add parameter for skipping access speed tests")
---
 arch/riscv/kernel/unaligned_access_speed.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/kernel/unaligned_access_speed.c +2 -2
index 67f1a0371659..323ccfcfbbb7 100644
@@ -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]>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Vladimir Kondratiev

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")
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
index 67f1a0371659..323ccfcfbbb7 100644
@@ -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 · 7 lines
Vladimir Kondratiev <[email protected]>


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
maintainer
#2 lore raw
In reply to Vladimir Kondratiev
Quoted 11 lines · Vladimir Kondratiev

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")

Thanks, queued for v7.4-rc with a stable@ cc.

- Paul