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 <ag...@suse.de>
---
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.