All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/process: remove unused variable in __switch_to_xtra()
@ 2019-12-17 12:09 Yunfeng Ye
  2019-12-17 12:29 ` Borislav Petkov
  0 siblings, 1 reply; 3+ messages in thread
From: Yunfeng Ye @ 2019-12-17 12:09 UTC (permalink / raw)
  To: tglx, mingo, bp, hpa, x86, luto, riel, dave.hansen, yeyunfeng,
	longman, mtosatti, linux-kernel, hushiyuan, linfeilong

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;

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
---
 arch/x86/kernel/process.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 61e93a318983..839b5244e3b7 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -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);

-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/process: remove unused variable in __switch_to_xtra()
  2019-12-17 12:09 [PATCH] x86/process: remove unused variable in __switch_to_xtra() Yunfeng Ye
@ 2019-12-17 12:29 ` Borislav Petkov
  2019-12-17 12:30   ` Yunfeng Ye
  0 siblings, 1 reply; 3+ messages in thread
From: Borislav Petkov @ 2019-12-17 12:29 UTC (permalink / raw)
  To: Yunfeng Ye
  Cc: tglx, mingo, hpa, x86, luto, riel, dave.hansen, longman,
	mtosatti, linux-kernel, hushiyuan, linfeilong

On Tue, Dec 17, 2019 at 08:09:08PM +0800, Yunfeng Ye wrote:
> 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;
> 
> Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
> ---
>  arch/x86/kernel/process.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
> index 61e93a318983..839b5244e3b7 100644
> --- a/arch/x86/kernel/process.c
> +++ b/arch/x86/kernel/process.c
> @@ -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);
> 
> -- 

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

:-)

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/process: remove unused variable in __switch_to_xtra()
  2019-12-17 12:29 ` Borislav Petkov
@ 2019-12-17 12:30   ` Yunfeng Ye
  0 siblings, 0 replies; 3+ messages in thread
From: Yunfeng Ye @ 2019-12-17 12:30 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: tglx, mingo, hpa, x86, luto, riel, dave.hansen, longman,
	mtosatti, linux-kernel, hushiyuan, linfeilong



On 2019/12/17 20:29, Borislav Petkov wrote:
> On Tue, Dec 17, 2019 at 08:09:08PM +0800, Yunfeng Ye wrote:
>> 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;
>>
>> Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
>> ---
>>  arch/x86/kernel/process.c | 4 ----
>>  1 file changed, 4 deletions(-)
>>
>> diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
>> index 61e93a318983..839b5244e3b7 100644
>> --- a/arch/x86/kernel/process.c
>> +++ b/arch/x86/kernel/process.c
>> @@ -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);
>>
>> -- 
> 
> Let me introduce you to your colleague yu kuai:
> 
ok, thanks.

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-17 12:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17 12:09 [PATCH] x86/process: remove unused variable in __switch_to_xtra() Yunfeng Ye
2019-12-17 12:29 ` Borislav Petkov
2019-12-17 12:30   ` Yunfeng Ye

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.