qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] USB: Fix build breakage in musb


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH] USB: Fix build breakage in musb
Date: Sun, 08 May 2011 18:08:03 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20110307 Iceowl/1.0b1 Icedove/3.0.11

Am 08.05.2011 17:54, schrieb Stefan Weil:
Am 08.05.2011 00:59, schrieb Alexander Graf:
Today's git failed building for me. It looks like a mismatching function
prototype definition.

This patch fixes compilation of arm-softmmu for me.

Signed-off-by: Alexander Graf <address@hidden>
---
hw/usb-musb.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/usb-musb.c b/hw/usb-musb.c
index b30caeb..85a2b6f 100644
--- a/hw/usb-musb.c
+++ b/hw/usb-musb.c
@@ -261,7 +261,7 @@

static void musb_attach(USBPort *port);
static void musb_detach(USBPort *port);
-static void musb_schedule_cb(USBDevice *dev, USBPacket *p);
+static inline void musb_schedule_cb(USBDevice *dev, USBPacket *p);

static USBPortOps musb_port_ops = {
.attach = musb_attach,

The patch fixes the warning, because now forward declaration and
function definition match, but it's not the correct approach.

Instead of adding 'inline' here, 'inline' should be removed from the definition. The function musb_schedule_cb is used via a function pointer, so it is never inline.

Regards,
Stefan W.

Looking closer at file hw/usb-musb.c, I'd even recommend removing
all 'inline' attributes there:

The functions musb_cb_tick0, musb_cb_tick1 are used via function pointer and a single direct call (which can be optimized by the compiler even without 'inline').

The function musb_packet is too large for a typical inline function.

Regards,
Stefan W.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]