2010-11-18 14:45:09

by Dhaval Giani

[permalink] [raw]
Subject: [PATCH] cpu.c: remove unused variable

cpu.c: remove unused variable

kernel/cpu.c: In function ‘take_cpu_down’:
kernel/cpu.c:200:15: warning: unused variable ‘cpu’

This variable is unused since param->hcpu is directly
used later on in cpu_notify.

Signed-off-by: Dhaval Giani <[email protected]>
---
kernel/cpu.c | 1 -
1 file changed, 1 deletion(-)

Index: linux-2.6/kernel/cpu.c
===================================================================
--- linux-2.6.orig/kernel/cpu.c
+++ linux-2.6/kernel/cpu.c
@@ -197,7 +197,6 @@ struct take_cpu_down_param {
static int __ref take_cpu_down(void *_param)
{
struct take_cpu_down_param *param = _param;
- unsigned int cpu = (unsigned long)param->hcpu;
int err;

/* Ensure this CPU doesn't handle any more interrupts. */


2010-11-18 15:44:17

by Oleg Nesterov

[permalink] [raw]
Subject: Re: [PATCH] cpu.c: remove unused variable

On 11/18, Dhaval Giani wrote:
>
> --- linux-2.6.orig/kernel/cpu.c
> +++ linux-2.6/kernel/cpu.c
> @@ -197,7 +197,6 @@ struct take_cpu_down_param {
> static int __ref take_cpu_down(void *_param)
> {
> struct take_cpu_down_param *param = _param;
> - unsigned int cpu = (unsigned long)param->hcpu;
> int err;

This is on top of Peter's patch, I guess.

Agreed, it looks unused.

Oleg.

2010-11-18 15:50:01

by Dhaval Giani

[permalink] [raw]
Subject: Re: [PATCH] cpu.c: remove unused variable

On Thu, Nov 18, 2010 at 4:37 PM, Oleg Nesterov <[email protected]> wrote:
> On 11/18, Dhaval Giani wrote:
>>
>> --- linux-2.6.orig/kernel/cpu.c
>> +++ linux-2.6/kernel/cpu.c
>> @@ -197,7 +197,6 @@ struct take_cpu_down_param {
>> ?static int __ref take_cpu_down(void *_param)
>> ?{
>> ? ? ? struct take_cpu_down_param *param = _param;
>> - ? ? unsigned int cpu = (unsigned long)param->hcpu;
>> ? ? ? int err;
>
> This is on top of Peter's patch, I guess.
>

current tip/master, so I guess so :-) Now if I can just figure out why
this configuration mess does not boot for me ;-)

Dhaval