diff mbox

[2/3] ehci: Fix unused-but-set-variable warning

Message ID 1306932992-30075-3-git-send-email-cfergeau@redhat.com
State New
Headers show

Commit Message

Christophe Fergeau June 1, 2011, 12:56 p.m. UTC
This warning is new in gcc 4.6.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
---
 hw/usb-ehci.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

Comments

David S. Ahern June 1, 2011, 3:53 p.m. UTC | #1
On 06/01/2011 06:56 AM, Christophe Fergeau wrote:
> @@ -1134,11 +1128,8 @@ static int ehci_process_itd(EHCIState *ehci,
>  
>              DPRINTF("ISOCH: buffer %08X len %d\n", ptr, len);
>  
> -            if (!dir) {
> +            if (!dir)
>                  cpu_physical_memory_rw(ptr, &ehci->buffer[0], len, 0);
> -                pid = USB_TOKEN_OUT;
> -            } else
> -                pid = USB_TOKEN_IN;
>  
>              ret = USB_RET_NODEV;
>  

I think you want those to be ehci->pid instead of deleting them.

David
Christophe Fergeau June 1, 2011, 4:21 p.m. UTC | #2
On Wed, Jun 01, 2011 at 09:53:46AM -0600, David Ahern wrote:
> I think you want those to be ehci->pid instead of deleting them.

Yeah, this is exactly what I was wondering while making this patch,
but couldn't decide which one was supposed to be given my total lack
of knowledge of USB and of this code :)

Thanks,

Christophe
diff mbox

Patch

diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
index f63519e..8a7b1bb 100644
--- a/hw/usb-ehci.c
+++ b/hw/usb-ehci.c
@@ -523,11 +523,8 @@  static void ehci_detach(USBPort *port)
 static void ehci_reset(void *opaque)
 {
     EHCIState *s = opaque;
-    uint8_t *pci_conf;
     int i;
 
-    pci_conf = s->dev.config;
-
     memset(&s->mmio[OPREGBASE], 0x00, MMIO_SIZE - OPREGBASE);
 
     s->usbcmd = NB_MAXINTRATE << USBCMD_ITC_SH;
@@ -1105,18 +1102,15 @@  static int ehci_process_itd(EHCIState *ehci,
     int ret;
     int i, j;
     int ptr;
-    int pid;
     int pg;
     int len;
     int dir;
     int devadr;
     int endp;
-    int maxpkt;
 
     dir =(itd->bufptr[1] & ITD_BUFPTR_DIRECTION);
     devadr = get_field(itd->bufptr[0], ITD_BUFPTR_DEVADDR);
     endp = get_field(itd->bufptr[0], ITD_BUFPTR_EP);
-    maxpkt = get_field(itd->bufptr[1], ITD_BUFPTR_MAXPKT);
 
     for(i = 0; i < 8; i++) {
         if (itd->transact[i] & ITD_XACT_ACTIVE) {
@@ -1134,11 +1128,8 @@  static int ehci_process_itd(EHCIState *ehci,
 
             DPRINTF("ISOCH: buffer %08X len %d\n", ptr, len);
 
-            if (!dir) {
+            if (!dir)
                 cpu_physical_memory_rw(ptr, &ehci->buffer[0], len, 0);
-                pid = USB_TOKEN_OUT;
-            } else
-                pid = USB_TOKEN_IN;
 
             ret = USB_RET_NODEV;