qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Fix a number of unused-but-set-variable warnings (new with gcc-4.6)
@ 2011-05-03 11:03 Hans de Goede
  2011-05-17 11:25 ` Christophe Fergeau
  2011-05-27 10:34 ` Amit Shah
  0 siblings, 2 replies; 7+ messages in thread
From: Hans de Goede @ 2011-05-03 11:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hans de Goede

---
 target-i386/kvm.c |    4 ++--
 tcg/tcg.c         |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index a13599d..e9e8d54 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -950,7 +950,7 @@ static int kvm_get_xsave(CPUState *env)
 #ifdef KVM_CAP_XSAVE
     struct kvm_xsave* xsave;
     int ret, i;
-    uint16_t cwd, swd, twd, fop;
+    uint16_t cwd, swd, twd;
 
     if (!kvm_has_xsave()) {
         return kvm_get_fpu(env);
@@ -966,7 +966,7 @@ static int kvm_get_xsave(CPUState *env)
     cwd = (uint16_t)xsave->region[0];
     swd = (uint16_t)(xsave->region[0] >> 16);
     twd = (uint16_t)xsave->region[1];
-    fop = (uint16_t)(xsave->region[1] >> 16);
+    /* fop = (uint16_t)(xsave->region[1] >> 16); */
     env->fpstt = (swd >> 11) & 7;
     env->fpus = swd;
     env->fpuc = cwd;
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 8748c05..11a8daf 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -585,7 +585,7 @@ void tcg_register_helper(void *func, const char *name)
 void tcg_gen_callN(TCGContext *s, TCGv_ptr func, unsigned int flags,
                    int sizemask, TCGArg ret, int nargs, TCGArg *args)
 {
-#ifdef TCG_TARGET_I386
+#if defined TCG_TARGET_I386 && TCG_TARGET_REG_BITS < 64 
     int call_type;
 #endif
     int i;
@@ -612,7 +612,7 @@ void tcg_gen_callN(TCGContext *s, TCGv_ptr func, unsigned int flags,
 
     *gen_opc_ptr++ = INDEX_op_call;
     nparam = gen_opparam_ptr++;
-#ifdef TCG_TARGET_I386
+#if defined TCG_TARGET_I386 && TCG_TARGET_REG_BITS < 64 
     call_type = (flags & TCG_CALL_TYPE_MASK);
 #endif
     if (ret != TCG_CALL_DUMMY_ARG) {
-- 
1.7.5

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

* Re: [Qemu-devel] [PATCH] Fix a number of unused-but-set-variable warnings (new with gcc-4.6)
  2011-05-03 11:03 Hans de Goede
@ 2011-05-17 11:25 ` Christophe Fergeau
  2011-05-17 17:51   ` Aurelien Jarno
  2011-05-27 10:34 ` Amit Shah
  1 sibling, 1 reply; 7+ messages in thread
From: Christophe Fergeau @ 2011-05-17 11:25 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1684 bytes --]

Hi Hans,

On Tue, May 03, 2011 at 01:03:40PM +0200, Hans de Goede wrote:
> diff --git a/target-i386/kvm.c b/target-i386/kvm.c
> index a13599d..e9e8d54 100644
> --- a/target-i386/kvm.c
> +++ b/target-i386/kvm.c
> @@ -950,7 +950,7 @@ static int kvm_get_xsave(CPUState *env)
> @@ -966,7 +966,7 @@ static int kvm_get_xsave(CPUState *env)
>      cwd = (uint16_t)xsave->region[0];
>      swd = (uint16_t)(xsave->region[0] >> 16);
>      twd = (uint16_t)xsave->region[1];
> -    fop = (uint16_t)(xsave->region[1] >> 16);
> +    /* fop = (uint16_t)(xsave->region[1] >> 16); */

Wouldn't it be better to drop this line?

>      env->fpstt = (swd >> 11) & 7;
>      env->fpus = swd;
>      env->fpuc = cwd;
> diff --git a/tcg/tcg.c b/tcg/tcg.c
> index 8748c05..11a8daf 100644
> --- a/tcg/tcg.c
> +++ b/tcg/tcg.c
> @@ -585,7 +585,7 @@ void tcg_register_helper(void *func, const char *name)
>  void tcg_gen_callN(TCGContext *s, TCGv_ptr func, unsigned int flags,
>                     int sizemask, TCGArg ret, int nargs, TCGArg *args)
>  {
> -#ifdef TCG_TARGET_I386
> +#if defined TCG_TARGET_I386 && TCG_TARGET_REG_BITS < 64 

This function uses #if defined(TCG_TARGET_I386) in other places, so I'd use
parentheses here for consistency.

>      int call_type;
>  #endif
>      int i;
> @@ -612,7 +612,7 @@ void tcg_gen_callN(TCGContext *s, TCGv_ptr func, unsigned int flags,
>  
>      *gen_opc_ptr++ = INDEX_op_call;
>      nparam = gen_opparam_ptr++;
> -#ifdef TCG_TARGET_I386
> +#if defined TCG_TARGET_I386 && TCG_TARGET_REG_BITS < 64 

Same here.

Apart from that, I also need this patch to be able to build qemu on fedora
15 :)

Christophe

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [Qemu-devel] [PATCH] Fix a number of unused-but-set-variable warnings (new with gcc-4.6)
  2011-05-17 11:25 ` Christophe Fergeau
@ 2011-05-17 17:51   ` Aurelien Jarno
  0 siblings, 0 replies; 7+ messages in thread
From: Aurelien Jarno @ 2011-05-17 17:51 UTC (permalink / raw)
  To: Hans de Goede; +Cc: qemu-devel

On Tue, May 17, 2011 at 01:25:10PM +0200, Christophe Fergeau wrote:
> Hi Hans,
> 
> On Tue, May 03, 2011 at 01:03:40PM +0200, Hans de Goede wrote:
> > diff --git a/target-i386/kvm.c b/target-i386/kvm.c
> > index a13599d..e9e8d54 100644
> > --- a/target-i386/kvm.c
> > +++ b/target-i386/kvm.c
> > @@ -950,7 +950,7 @@ static int kvm_get_xsave(CPUState *env)
> > @@ -966,7 +966,7 @@ static int kvm_get_xsave(CPUState *env)
> >      cwd = (uint16_t)xsave->region[0];
> >      swd = (uint16_t)(xsave->region[0] >> 16);
> >      twd = (uint16_t)xsave->region[1];
> > -    fop = (uint16_t)(xsave->region[1] >> 16);
> > +    /* fop = (uint16_t)(xsave->region[1] >> 16); */
> 
> Wouldn't it be better to drop this line?
> 
> >      env->fpstt = (swd >> 11) & 7;
> >      env->fpus = swd;
> >      env->fpuc = cwd;
> > diff --git a/tcg/tcg.c b/tcg/tcg.c
> > index 8748c05..11a8daf 100644
> > --- a/tcg/tcg.c
> > +++ b/tcg/tcg.c
> > @@ -585,7 +585,7 @@ void tcg_register_helper(void *func, const char *name)
> >  void tcg_gen_callN(TCGContext *s, TCGv_ptr func, unsigned int flags,
> >                     int sizemask, TCGArg ret, int nargs, TCGArg *args)
> >  {
> > -#ifdef TCG_TARGET_I386
> > +#if defined TCG_TARGET_I386 && TCG_TARGET_REG_BITS < 64 
> 
> This function uses #if defined(TCG_TARGET_I386) in other places, so I'd use
> parentheses here for consistency.
> 
> >      int call_type;
> >  #endif
> >      int i;
> > @@ -612,7 +612,7 @@ void tcg_gen_callN(TCGContext *s, TCGv_ptr func, unsigned int flags,
> >  
> >      *gen_opc_ptr++ = INDEX_op_call;
> >      nparam = gen_opparam_ptr++;
> > -#ifdef TCG_TARGET_I386
> > +#if defined TCG_TARGET_I386 && TCG_TARGET_REG_BITS < 64 
> 
> Same here.
> 
> Apart from that, I also need this patch to be able to build qemu on fedora
> 15 :)
> 

You should also probably split the patch in two parts, as it touch
totally different parts of QEMU, and thus is going to be
reviewed/applied by different person. I am fine with the TCG part after
the comments from Christophe, so I'll apply it as soon as the new
version is out.

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

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

* Re: [Qemu-devel] [PATCH] Fix a number of unused-but-set-variable warnings (new with gcc-4.6)
  2011-05-03 11:03 Hans de Goede
  2011-05-17 11:25 ` Christophe Fergeau
@ 2011-05-27 10:34 ` Amit Shah
  1 sibling, 0 replies; 7+ messages in thread
From: Amit Shah @ 2011-05-27 10:34 UTC (permalink / raw)
  To: Hans de Goede; +Cc: qemu-devel

On (Tue) 03 May 2011 [13:03:40], Hans de Goede wrote:
> ---
>  target-i386/kvm.c |    4 ++--
>  tcg/tcg.c         |    4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)

Thanks; just got hit by this.

However, there are a couple of whitespace issues:

> --- a/tcg/tcg.c
> +++ b/tcg/tcg.c
> @@ -585,7 +585,7 @@ void tcg_register_helper(void *func, const char *name)
>  void tcg_gen_callN(TCGContext *s, TCGv_ptr func, unsigned int flags,
>                     int sizemask, TCGArg ret, int nargs, TCGArg *args)
>  {
> -#ifdef TCG_TARGET_I386
> +#if defined TCG_TARGET_I386 && TCG_TARGET_REG_BITS < 64 
>      int call_type;
>  #endif
>      int i;
> @@ -612,7 +612,7 @@ void tcg_gen_callN(TCGContext *s, TCGv_ptr func, unsigned int flags,
>  
>      *gen_opc_ptr++ = INDEX_op_call;
>      nparam = gen_opparam_ptr++;
> -#ifdef TCG_TARGET_I386
> +#if defined TCG_TARGET_I386 && TCG_TARGET_REG_BITS < 64 
>      call_type = (flags & TCG_CALL_TYPE_MASK);
>  #endif
>      if (ret != TCG_CALL_DUMMY_ARG) {

Both these lines have a trailing space.

Care to resubmit with Anthony in CC?  You can add:

Acked-by: Amit Shah <amit.shah@redhat.com>

		Amit

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

* [Qemu-devel] [PATCH] Fix a number of unused-but-set-variable warnings (new with gcc-4.6)
@ 2011-06-08  8:28 Hans de Goede
  2011-06-08  9:22 ` Kevin Wolf
  0 siblings, 1 reply; 7+ messages in thread
From: Hans de Goede @ 2011-06-08  8:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hans de Goede

---
 hw/lsi53c895a.c   |    2 --
 target-i386/kvm.c |    4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index 83084b6..90c6cbc 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -889,7 +889,6 @@ static void lsi_do_msgout(LSIState *s)
     uint8_t msg;
     int len;
     uint32_t current_tag;
-    SCSIDevice *current_dev;
     lsi_request *current_req, *p, *p_next;
     int id;
 
@@ -901,7 +900,6 @@ static void lsi_do_msgout(LSIState *s)
         current_req = lsi_find_by_tag(s, current_tag);
     }
     id = (current_tag >> 8) & 0xf;
-    current_dev = s->bus.devs[id];
 
     DPRINTF("MSG out len=%d\n", s->dbc);
     while (s->dbc) {
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index faedc6c..6f003b0 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -970,7 +970,7 @@ static int kvm_get_xsave(CPUState *env)
 #ifdef KVM_CAP_XSAVE
     struct kvm_xsave* xsave;
     int ret, i;
-    uint16_t cwd, swd, twd, fop;
+    uint16_t cwd, swd, twd;
 
     if (!kvm_has_xsave()) {
         return kvm_get_fpu(env);
@@ -986,7 +986,7 @@ static int kvm_get_xsave(CPUState *env)
     cwd = (uint16_t)xsave->region[0];
     swd = (uint16_t)(xsave->region[0] >> 16);
     twd = (uint16_t)xsave->region[1];
-    fop = (uint16_t)(xsave->region[1] >> 16);
+    /* fop = (uint16_t)(xsave->region[1] >> 16); */
     env->fpstt = (swd >> 11) & 7;
     env->fpus = swd;
     env->fpuc = cwd;
-- 
1.7.5.1

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

* Re: [Qemu-devel] [PATCH] Fix a number of unused-but-set-variable warnings (new with gcc-4.6)
  2011-06-08  8:28 [Qemu-devel] [PATCH] Fix a number of unused-but-set-variable warnings (new with gcc-4.6) Hans de Goede
@ 2011-06-08  9:22 ` Kevin Wolf
  2011-06-08 11:22   ` Christophe Fergeau
  0 siblings, 1 reply; 7+ messages in thread
From: Kevin Wolf @ 2011-06-08  9:22 UTC (permalink / raw)
  To: Hans de Goede; +Cc: qemu-devel

Am 08.06.2011 10:28, schrieb Hans de Goede:
> ---
>  hw/lsi53c895a.c   |    2 --
>  target-i386/kvm.c |    4 ++--
>  2 files changed, 2 insertions(+), 4 deletions(-)

SoB is missing. And don't we have multiple patches to fix the same thing
already? Someone should just merge them...

Kevin

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

* Re: [Qemu-devel] [PATCH] Fix a number of unused-but-set-variable warnings (new with gcc-4.6)
  2011-06-08  9:22 ` Kevin Wolf
@ 2011-06-08 11:22   ` Christophe Fergeau
  0 siblings, 0 replies; 7+ messages in thread
From: Christophe Fergeau @ 2011-06-08 11:22 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Hans de Goede, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 500 bytes --]

On Wed, Jun 08, 2011 at 11:22:06AM +0200, Kevin Wolf wrote:
> Am 08.06.2011 10:28, schrieb Hans de Goede:
> > ---
> >  hw/lsi53c895a.c   |    2 --
> >  target-i386/kvm.c |    4 ++--
> >  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> SoB is missing. And don't we have multiple patches to fix the same thing
> already? Someone should just merge them...

Yes these fixes have already been submitted several times, it would indeed
be good to finally have them merged ;)

Christophe

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

end of thread, other threads:[~2011-06-08 11:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-08  8:28 [Qemu-devel] [PATCH] Fix a number of unused-but-set-variable warnings (new with gcc-4.6) Hans de Goede
2011-06-08  9:22 ` Kevin Wolf
2011-06-08 11:22   ` Christophe Fergeau
  -- strict thread matches above, loose matches on Subject: below --
2011-05-03 11:03 Hans de Goede
2011-05-17 11:25 ` Christophe Fergeau
2011-05-17 17:51   ` Aurelien Jarno
2011-05-27 10:34 ` Amit Shah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).