Skip to contentSkip to conversation

usb: build fixes.

GIT PULL New Gerd Hoffmann 3 participants 6 messages May 9, 2011

lore
Share & tools
lore
#0 lore raw

Hi,

Two build issues slipped through with the last usb patch queue pull. Looks like I should do test builds with a more recent gcc ...

Here are the fixes.

pleae pull,
Gerd

The following changes since commit 85097db6956bc86e2377b63a8309cb8b24d54139:

irq: Privatize CPU_INTERRUPT_NMI. (2011-05-08 16:55:24 +0000)

are available in the git repository at:
git://git.kraxel.org/qemu usb.8.pull

Gerd Hoffmann (1):
usb-musb: uninline functions

Stefan Weil (1):
usb-linux: Add missing break statement

 hw/usb-musb.c |    8 ++++----
 usb-linux.c   |    1 +
 2 files changed, 5 insertions(+), 4 deletions(-)
#1 lore raw

PATCH 1/2 usb-musb: uninline functions

Prototype without "inline" keyword breaks the build with some gcc versions. Noticed by Alexander Graf.

Fix this by removing the inline keywork everywhere. Some functions can't be inlined anyway as the are referenced using function pointers. Beside that gcc does a pretty good job on auto-inlining these days.

---
 hw/usb-musb.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
hw/usb-musb.c +4 -4
index b30caeb..38986d3 100644
@@ -497,14 +497,14 @@ static void musb_detach(USBPort *port)
     musb_session_update(s, 1, s->session);
 }
 
-static inline void musb_cb_tick0(void *opaque)
+static void musb_cb_tick0(void *opaque)
 {
     MUSBEndPoint *ep = (MUSBEndPoint *) opaque;
 
     ep->delayed_cb[0](&ep->packey[0].p, opaque);
 }
 
-static inline void musb_cb_tick1(void *opaque)
+static void musb_cb_tick1(void *opaque)
 {
     MUSBEndPoint *ep = (MUSBEndPoint *) opaque;
 
@@ -513,7 +513,7 @@ static inline void musb_cb_tick1(void *opaque)
 
 #define musb_cb_tick	(dir ? musb_cb_tick1 : musb_cb_tick0)
 
-static inline void musb_schedule_cb(USBDevice *dev, USBPacket *packey)
+static void musb_schedule_cb(USBDevice *dev, USBPacket *packey)
 {
     MUSBPacket *p = container_of(packey, MUSBPacket, p);
     MUSBEndPoint *ep = p->ep;
@@ -572,7 +572,7 @@ static int musb_timeout(int ttype, int speed, int val)
     hw_error("bad interval\n");
 }
 
-static inline void musb_packet(MUSBState *s, MUSBEndPoint *ep,
+static void musb_packet(MUSBState *s, MUSBEndPoint *ep,
                 int epnum, int pid, int len, USBCallback cb, int dir)
 {
     int ret;
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/2 usb-linux: Add missing break statement

In reply to Gerd Hoffmann

From: Stefan Weil <[email protected]>

cppcheck report:
usb-linux.c:661: warning: Redundant assignment of "len" in switch

Please check whether adding a break statement is the correct solution for this warning.

---
 usb-linux.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
usb-linux.c +1 -0
index 36a01ea..0ef1d26 100644
@@ -659,6 +659,7 @@ static int usb_host_handle_iso_data(USBHostDevice *s, USBPacket *p, int in)
                         switch(errno) {
                         case ETIMEDOUT:
                             len = USB_RET_NAK;
+                            break;
                         case EPIPE:
                         default:
                             len = USB_RET_STALL;
Signature · 1 line
1.7.1
#3 lore raw
In reply to Gerd Hoffmann
Quoted 6 lines · Gerd Hoffmann

Here are the fixes.

pleae pull,

Stefan Weil (1):
     usb-linux: Add missing break statement

The commit comment for this change looks like it still includes the remark:

# Please check whether adding a break statement is the correct

# solution for this warning.

...I think that should be removed since we have actually done the check during review, right?

thanks
-- PMM

#4 lore raw
Quoted 5 lines · Peter Maydell
Quoted 3 lines · Gerd Hoffmann

Here are the fixes.

pleae pull,

Quoted 8 lines
Quoted 2 lines

Stefan Weil (1):
usb-linux: Add missing break statement

The commit comment for this change looks like it still includes the remark:

# Please check whether adding a break statement is the correct

# solution for this warning.

Zapped, pushed usb.9.pull branch with the rewritten comment.

cheers,
Gerd

#5 lore raw
Quoted 9 lines · Gerd Hoffmann
Quoted 8 lines · Peter Maydell
Quoted 6 lines · Gerd Hoffmann

Here are the fixes.

pleae pull,

Stefan Weil (1):
usb-linux: Add missing break statement

Quoted 7 lines
Quoted 5 lines

The commit comment for this change looks like it still includes the remark:

# Please check whether adding a break statement is the correct

# solution for this warning.

Zapped, pushed usb.9.pull branch with the rewritten comment.\

Pulled. Thanks.

Regards,

Anthony Liguori

Quoted 5 lines

cheers,
Gerd