mips: remove unused variable 'prev_state'
Subsystems (2)
PATCH 1/1 mips: remove unused variable 'prev_state'
GCC reports the following warning with W=1:
arch/mips/kernel/traps.c:1593:17: warning:
variable 'prev_state' set but not used [-Wunused-but-set-variable]
1593 | enum ctx_state prev_state;
| ^~~~~~~~~~This variable is not used in function , this commit remove it to fix the warning.
--- arch/mips/kernel/traps.c | 2 -- 1 file changed, 2 deletions(-)
arch/mips/kernel/traps.c +0 -2
@@ -1590,10 +1590,8 @@ asmlinkage void do_watch(struct pt_regs *regs) asmlinkage void do_mcheck(struct pt_regs *regs) {int multi_match = regs->cp0_status &ST0_TS ; -enum ctx_state prev_state;mm_segment_t old_fs =get_fs (); - prev_state =exception_enter ();show_regs (regs);if (multi_match) {
Quoted 21 lines · Xu Jia
GCC reports the following warning with W=1:
arch/mips/kernel/traps.c:1593:17: warning:
variable 'prev_state' set but not used [-Wunused-but-set-variable]1593 | enum ctx_state prev_state; | ^~~~~~~~~~This variable is not used in function , this commit remove it to fix the warning.
Reported-by Hulk Robot <[email protected]>Signed-off-by Xu Jia <[email protected]>--- arch/mips/kernel/traps.c | 2 -- 1 file changed, 2 deletions(-)arch/mips/kernel/traps.c +0
-0
arch/mips/kernel/traps.c asmlinkage void do_watch(struct pt_regs *regs) · line 1596
Quoted 7 lines
arch/mips/kernel/traps.c +0
-2@@ -1590,10 +1590,8 @@ asmlinkage void do_watch(struct pt_regs *regs) asmlinkage void do_mcheck(struct pt_regs *regs) {int multi_match = regs->cp0_status &ST0_TS ; -enum ctx_state prev_state;mm_segment_t old_fs =get_fs (); - prev_state =exception_enter ();
The call to exception_enter() is required for context tracking, so removing this call is not the correct solution.
Quoted 4 lines
arch/mips/kernel/traps.c +0
-0show_regs (regs);if (multi_match) {
Quoted 21 lines · Xu Jia
GCC reports the following warning with W=1:
arch/mips/kernel/traps.c:1593:17: warning:
variable 'prev_state' set but not used [-Wunused-but-set-variable]1593 | enum ctx_state prev_state; | ^~~~~~~~~~This variable is not used in function , this commit remove it to fix the warning.
Reported-by Hulk Robot <[email protected]>Signed-off-by Xu Jia <[email protected]>--- arch/mips/kernel/traps.c | 2 -- 1 file changed, 2 deletions(-)arch/mips/kernel/traps.c +0
-0
arch/mips/kernel/traps.c asmlinkage void do_watch(struct pt_regs *regs) · line 1596
Quoted 7 lines
arch/mips/kernel/traps.c +0
-2@@ -1590,10 +1590,8 @@ asmlinkage void do_watch(struct pt_regs *regs) asmlinkage void do_mcheck(struct pt_regs *regs) {int multi_match = regs->cp0_status &ST0_TS ; -enum ctx_state prev_state;mm_segment_t old_fs =get_fs (); - prev_state =exception_enter ();
Pretty sure the exception_enter() is still required...
arch/mips/kernel/traps.c asmlinkage void do_watch(struct pt_regs *regs) · line 1595
Quoted 1 line
arch/mips/kernel/traps.c +0
-0show_regs (regs);
regards,
dan carpenter