LoongArch: use EXCCODE_INT_START instead of hard coded value
PATCH 1/1 LoongArch: use EXCCODE_INT_START instead of hard coded value
The for loop in per_cpu_trap_init function use a hard coded length while setting default exception handler. Use the proper define instead of hard coded value.
--- arch/loongarch/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/loongarch/kernel/traps.c +1 -1
@@ -755,7 +755,7 @@ void per_cpu_trap_init(int cpu)/* Initialise exception handlers */ if (cpu ==0 ) -for (i =0 ; i <64 ; i++) +for (i =0 ; i <EXCCODE_INT_START ; i++)set_handler (i *VECSIZE , handle_reserved,VECSIZE );tlb_init (cpu);
base-commit: 804f6d04b1adae9602edbd6410c0ba3a556964fe
Signature · 1 line
2.39.2
Hi Huacai,
Kindly PING for this tiny patch. :)
Thanks,
Enze
Quoted 27 lines · Enze Li
The for loop in
per_cpu_trap_initfunction use a hard coded length while
setting default exception handler. Use the proper define instead of hard coded value.Signed-off-by Enze Li <[email protected]>--- arch/loongarch/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/loongarch/kernel/traps.c +1
-1@@ -755,7 +755,7 @@ void per_cpu_trap_init(int cpu)/* Initialise exception handlers */ if (cpu ==0 ) -for (i =0 ; i <64 ; i++) +for (i =0 ; i <EXCCODE_INT_START ; i++)set_handler (i *VECSIZE , handle_reserved,VECSIZE );
tlb_init(cpu);base-commit:
804f6d04b1adae9602edbd6410c0ba3a556964fe
Huacai Chen
maintainerThough EXCCODE_INT_START is 64, its meaning is not suitable in this case.
Huacai
Quoted 37 lines · Enze Li
Hi Huacai,
Kindly PING for this tiny patch. :)
Thanks,
EnzeQuoted 27 lines · Enze Li
The for loop in
per_cpu_trap_initfunction use a hard coded length while
setting default exception handler. Use the proper define instead of hard coded value.Signed-off-by Enze Li <[email protected]>--- arch/loongarch/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/loongarch/kernel/traps.c +1
-1@@ -755,7 +755,7 @@ void per_cpu_trap_init(int cpu)/* Initialise exception handlers */ if (cpu ==0 ) -for (i =0 ; i <64 ; i++) +for (i =0 ; i <EXCCODE_INT_START ; i++)set_handler (i *VECSIZE , handle_reserved,VECSIZE );tlb_init(cpu);base-commit:
804f6d04b1adae9602edbd6410c0ba3a556964fe
Hi Huacai,
Thanks for your review :)
Quoted 2 lines · Huacai Chen
Though
EXCCODE_INT_STARTis 64, its meaning is not suitable in this case.
Humm...Yeah. Sharing the same macro may make things difficult to understand.
What about defining a new macro to indicate this? Something like EXCCODE_NOR_NUM or EXCCODE_EXC_NUM?
For a newcomer, thank you in advance for your patience.
Thanks,
Enze
Quoted 41 lines
Huacai
Quoted 37 lines · Enze Li
Hi Huacai,
Kindly PING for this tiny patch. :)
Thanks,
EnzeQuoted 29 lines · Enze Li
The for loop in
per_cpu_trap_initfunction use a hard coded length
while
setting default exception handler. Use the proper define instead of
hard coded value.Signed-off-by Enze Li <[email protected]>--- arch/loongarch/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/loongarch/kernel/traps.c +1
-1@@ -755,7 +755,7 @@ void per_cpu_trap_init(int cpu)/* Initialise exception handlers */ if (cpu ==0 ) -for (i =0 ; i <64 ; i++) +for (i =0 ; i <EXCCODE_INT_START ; i++)set_handler (i *VECSIZE , handle_reserved,VECSIZE );tlb_init(cpu);base-commit:
804f6d04b1adae9602edbd6410c0ba3a556964fe
Huacai Chen
maintainerQuoted 6 lines · Enze Li
Hi Huacai,
Thanks for your review :)
On Mon, 2023-03-13 at 15:52 +0800, Huacai Chen wrote:
Quoted 8 lines
Quoted 2 lines
Though
EXCCODE_INT_STARTis 64, its meaning is not suitable in this case.Humm...Yeah. Sharing the same macro may make things difficult to understand.
What about defining a new macro to indicate this? Something like
EXCCODE_NOR_NUMorEXCCODE_EXC_NUM?
I prefer to keep it as original.
Huacai
Quoted 49 lines
For a newcomer, thank you in advance for your patience.
Thanks,
EnzeQuoted 41 lines
Huacai
Quoted 37 lines · Enze Li
Hi Huacai,
Kindly PING for this tiny patch. :)
Thanks,
EnzeQuoted 29 lines · Enze Li
The for loop in
per_cpu_trap_initfunction use a hard coded length
while
setting default exception handler. Use the proper define instead of
hard coded value.Signed-off-by Enze Li <[email protected]>--- arch/loongarch/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/loongarch/kernel/traps.c +1
-1@@ -755,7 +755,7 @@ void per_cpu_trap_init(int cpu)/* Initialise exception handlers */ if (cpu ==0 ) -for (i =0 ; i <64 ; i++) +for (i =0 ; i <EXCCODE_INT_START ; i++)set_handler (i *VECSIZE , handle_reserved,VECSIZE );tlb_init(cpu);base-commit:
804f6d04b1adae9602edbd6410c0ba3a556964fe