Patchwork ppc: remove a write-only variable

login
register
mail settings
Submitter Blue Swirl
Date April 9, 2011, 2:56 p.m.
Message ID <BANLkTimM42+rbZLG3zioZ0XNfahy=aGHeA@mail.gmail.com>
Download mbox | patch
Permalink /patch/90467/
State New
Headers show

Comments

Blue Swirl - April 9, 2011, 2:56 p.m.
Remove a write-only variable, spotted by GCC 4.6.0:
/src/qemu/hw/ppc.c: In function 'power7_set_irq':
/src/qemu/hw/ppc.c:255:9: error: variable 'cur_level' set but not used
[-Werror=unused-but-set-variable]

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 hw/ppc.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
Alexander Graf - April 9, 2011, 3:28 p.m.
Am 09.04.2011 um 16:56 schrieb Blue Swirl <blauwirbel@gmail.com>:

> Remove a write-only variable, spotted by GCC 4.6.0:
> /src/qemu/hw/ppc.c: In function 'power7_set_irq':
> /src/qemu/hw/ppc.c:255:9: error: variable 'cur_level' set but not used
> [-Werror=unused-but-set-variable]
> 
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
> ---
> hw/ppc.c |    2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/ppc.c b/hw/ppc.c
> index dabb816..1873328 100644
> --- a/hw/ppc.c
> +++ b/hw/ppc.c
> @@ -252,11 +252,9 @@ void ppc970_irq_init (CPUState *env)
> static void power7_set_irq (void *opaque, int pin, int level)
> {
>     CPUState *env = opaque;
> -    int cur_level;
> 
>     LOG_IRQ("%s: env %p pin %d level %d\n", __func__,
>                 env, pin, level);
> -    cur_level = (env->irq_input_state >> pin) & 1;

David, Ben?


Alex

>
David Gibson - April 11, 2011, 4:30 a.m.
On Sat, Apr 09, 2011 at 05:28:06PM +0200, Alexander Graf wrote:
> 
> 
> 
> 
> Am 09.04.2011 um 16:56 schrieb Blue Swirl <blauwirbel@gmail.com>:
> 
> > Remove a write-only variable, spotted by GCC 4.6.0:
> > /src/qemu/hw/ppc.c: In function 'power7_set_irq':
> > /src/qemu/hw/ppc.c:255:9: error: variable 'cur_level' set but not used
> > [-Werror=unused-but-set-variable]
> > 
> > Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
> > ---
> > hw/ppc.c |    2 --
> > 1 files changed, 0 insertions(+), 2 deletions(-)
> > 
> > diff --git a/hw/ppc.c b/hw/ppc.c
> > index dabb816..1873328 100644
> > --- a/hw/ppc.c
> > +++ b/hw/ppc.c
> > @@ -252,11 +252,9 @@ void ppc970_irq_init (CPUState *env)
> > static void power7_set_irq (void *opaque, int pin, int level)
> > {
> >     CPUState *env = opaque;
> > -    int cur_level;
> > 
> >     LOG_IRQ("%s: env %p pin %d level %d\n", __func__,
> >                 env, pin, level);
> > -    cur_level = (env->irq_input_state >> pin) & 1;
> 
> David, Ben?

That should be fine.  It's a hang over from the ppc970 code which I
adapted.
Alexander Graf - April 11, 2011, 7:48 a.m.
On 11.04.2011, at 06:30, David Gibson wrote:

> On Sat, Apr 09, 2011 at 05:28:06PM +0200, Alexander Graf wrote:
>> 
>> 
>> 
>> 
>> Am 09.04.2011 um 16:56 schrieb Blue Swirl <blauwirbel@gmail.com>:
>> 
>>> Remove a write-only variable, spotted by GCC 4.6.0:
>>> /src/qemu/hw/ppc.c: In function 'power7_set_irq':
>>> /src/qemu/hw/ppc.c:255:9: error: variable 'cur_level' set but not used
>>> [-Werror=unused-but-set-variable]
>>> 
>>> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
>>> ---
>>> hw/ppc.c |    2 --
>>> 1 files changed, 0 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/hw/ppc.c b/hw/ppc.c
>>> index dabb816..1873328 100644
>>> --- a/hw/ppc.c
>>> +++ b/hw/ppc.c
>>> @@ -252,11 +252,9 @@ void ppc970_irq_init (CPUState *env)
>>> static void power7_set_irq (void *opaque, int pin, int level)
>>> {
>>>    CPUState *env = opaque;
>>> -    int cur_level;
>>> 
>>>    LOG_IRQ("%s: env %p pin %d level %d\n", __func__,
>>>                env, pin, level);
>>> -    cur_level = (env->irq_input_state >> pin) & 1;
>> 
>> David, Ben?
> 
> That should be fine.  It's a hang over from the ppc970 code which I
> adapted.

Alright.

Acked-by: Alexander Graf <agraf@suse.de>

Blue, mind to apply it directly? That's easier than going through my tree.


Alex
Blue Swirl - April 11, 2011, 5:25 p.m.
On Mon, Apr 11, 2011 at 10:48 AM, Alexander Graf <agraf@suse.de> wrote:
>
> On 11.04.2011, at 06:30, David Gibson wrote:
>
>> On Sat, Apr 09, 2011 at 05:28:06PM +0200, Alexander Graf wrote:
>>>
>>>
>>>
>>>
>>> Am 09.04.2011 um 16:56 schrieb Blue Swirl <blauwirbel@gmail.com>:
>>>
>>>> Remove a write-only variable, spotted by GCC 4.6.0:
>>>> /src/qemu/hw/ppc.c: In function 'power7_set_irq':
>>>> /src/qemu/hw/ppc.c:255:9: error: variable 'cur_level' set but not used
>>>> [-Werror=unused-but-set-variable]
>>>>
>>>> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
>>>> ---
>>>> hw/ppc.c |    2 --
>>>> 1 files changed, 0 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/hw/ppc.c b/hw/ppc.c
>>>> index dabb816..1873328 100644
>>>> --- a/hw/ppc.c
>>>> +++ b/hw/ppc.c
>>>> @@ -252,11 +252,9 @@ void ppc970_irq_init (CPUState *env)
>>>> static void power7_set_irq (void *opaque, int pin, int level)
>>>> {
>>>>    CPUState *env = opaque;
>>>> -    int cur_level;
>>>>
>>>>    LOG_IRQ("%s: env %p pin %d level %d\n", __func__,
>>>>                env, pin, level);
>>>> -    cur_level = (env->irq_input_state >> pin) & 1;
>>>
>>> David, Ben?
>>
>> That should be fine.  It's a hang over from the ppc970 code which I
>> adapted.
>
> Alright.
>
> Acked-by: Alexander Graf <agraf@suse.de>
>
> Blue, mind to apply it directly? That's easier than going through my tree.

Thanks for the ack, applied.

Patch

diff --git a/hw/ppc.c b/hw/ppc.c
index dabb816..1873328 100644
--- a/hw/ppc.c
+++ b/hw/ppc.c
@@ -252,11 +252,9 @@  void ppc970_irq_init (CPUState *env)
 static void power7_set_irq (void *opaque, int pin, int level)
 {
     CPUState *env = opaque;
-    int cur_level;

     LOG_IRQ("%s: env %p pin %d level %d\n", __func__,
                 env, pin, level);
-    cur_level = (env->irq_input_state >> pin) & 1;

     switch (pin) {
     case POWER7_INPUT_INT: