Skip to contentSkip to conversation

x86/process: remove unused variable in __switch_to_xtra()

PATCH In review Yunfeng Ye 2 participants 3 messages Dec 17, 2019 x86

lore
Share & tools
lore

Yunfeng Ye

author
#0 lore raw

PATCH 1/1 x86/process: remove unused variable in __switch_to_xtra()

After the commit ecc7e37d4dad ("x86/io: Speedup schedule out of I/O bitmap user") and commit 22fe5b0439dd ("x86/ioperm: Move TSS bitmap update to exit to user work"), warning is found:

arch/x86/kernel/process.c: In function ‘__switch_to_xtra’:
arch/x86/kernel/process.c:618:31: warning: variable ‘next’ set but not used [-Wunused-but-set-variable]

  struct thread_struct *prev, *next;
                               ^~~~
arch/x86/kernel/process.c:618:24: warning: variable ‘prev’ set but not
used [-Wunused-but-set-variable]
  struct thread_struct *prev, *next;
                        ^~~~

Fix this by removing the unused variable @prev and @next;

---
 arch/x86/kernel/process.c | 4 ----
 1 file changed, 4 deletions(-)
arch/x86/kernel/process.c +0 -4
index 61e93a318983..839b5244e3b7 100644
@@ -615,12 +615,8 @@ void speculation_ctrl_update_current(void)
 
 void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p)
 {
-	struct thread_struct *prev, *next;
 	unsigned long tifp, tifn;
 
-	prev = &prev_p->thread;
-	next = &next_p->thread;
-
 	tifn = READ_ONCE(task_thread_info(next_p)->flags);
 	tifp = READ_ONCE(task_thread_info(prev_p)->flags);
 
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 28 lines · Yunfeng Ye

After the commit ecc7e37d4dad ("x86/io: Speedup schedule out of I/O bitmap user") and commit 22fe5b0439dd ("x86/ioperm: Move TSS bitmap update to exit to user work"), warning is found:

arch/x86/kernel/process.c: In function ‘__switch_to_xtra’:
arch/x86/kernel/process.c:618:31: warning: variable ‘next’ set but not used [-Wunused-but-set-variable]

  struct thread_struct *prev, *next;
                               ^~~~
arch/x86/kernel/process.c:618:24: warning: variable ‘prev’ set but not
used [-Wunused-but-set-variable]
  struct thread_struct *prev, *next;
                        ^~~~

Fix this by removing the unused variable @prev and @next;

---
 arch/x86/kernel/process.c | 4 ----
 1 file changed, 4 deletions(-)
arch/x86/kernel/process.c +0 -0
index 61e93a318983..839b5244e3b7 100644
@@ -615,12 +615,8 @@ void speculation_ctrl_update_current(void)
 
 void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p)

arch/x86/kernel/process.c void speculation_ctrl_update_current(void) · line 622

Quoted 10 lines
arch/x86/kernel/process.c +0 -4
 {
-	struct thread_struct *prev, *next;
 	unsigned long tifp, tifn;
 
-	prev = &prev_p->thread;
-	next = &next_p->thread;
-
 	tifn = READ_ONCE(task_thread_info(next_p)->flags);
 	tifp = READ_ONCE(task_thread_info(prev_p)->flags);
 

Let me introduce you to your colleague yu kuai:

https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=x86/cleanups&id=27353d5785bca61bb49cfd7c78e14f1d21e66ec5

:-)

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
author
#2 lore raw
Quoted 38 lines · Borislav Petkov
Quoted 37 lines · Yunfeng Ye

After the commit ecc7e37d4dad ("x86/io: Speedup schedule out of I/O bitmap user") and commit 22fe5b0439dd ("x86/ioperm: Move TSS bitmap update to exit to user work"), warning is found:

arch/x86/kernel/process.c: In function ‘__switch_to_xtra’:
arch/x86/kernel/process.c:618:31: warning: variable ‘next’ set but not used [-Wunused-but-set-variable]

  struct thread_struct *prev, *next;
                               ^~~~
arch/x86/kernel/process.c:618:24: warning: variable ‘prev’ set but not
used [-Wunused-but-set-variable]
  struct thread_struct *prev, *next;
                        ^~~~

Fix this by removing the unused variable @prev and @next;

---
 arch/x86/kernel/process.c | 4 ----
 1 file changed, 4 deletions(-)
arch/x86/kernel/process.c +0 -4
index 61e93a318983..839b5244e3b7 100644
@@ -615,12 +615,8 @@ void speculation_ctrl_update_current(void)
 
 void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p)
 {
-	struct thread_struct *prev, *next;
 	unsigned long tifp, tifn;
 
-	prev = &prev_p->thread;
-	next = &next_p->thread;
-
 	tifn = READ_ONCE(task_thread_info(next_p)->flags);
 	tifp = READ_ONCE(task_thread_info(prev_p)->flags);
 
Quoted 4 lines
Quoted 1 line

Let me introduce you to your colleague yu kuai:

ok, thanks.

Quoted 4 lines

https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=x86/cleanups&id=27353d5785bca61bb49cfd7c78e14f1d21e66ec5

:-)