* [Qemu-devel] [PATCH] USB: Fix build breakage in musb
@ 2011-05-07 22:59 Alexander Graf
2011-05-08 15:40 ` Andreas Färber
2011-05-08 15:54 ` Stefan Weil
0 siblings, 2 replies; 6+ messages in thread
From: Alexander Graf @ 2011-05-07 22:59 UTC (permalink / raw)
To: QEMU-devel Developers; +Cc: Gerd Hoffmann
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 <agraf@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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] USB: Fix build breakage in musb
2011-05-07 22:59 [Qemu-devel] [PATCH] USB: Fix build breakage in musb Alexander Graf
@ 2011-05-08 15:40 ` Andreas Färber
2011-05-08 15:54 ` Stefan Weil
1 sibling, 0 replies; 6+ messages in thread
From: Andreas Färber @ 2011-05-08 15:40 UTC (permalink / raw)
To: Alexander Graf; +Cc: QEMU-devel Developers, Gerd Hoffmann
Am 08.05.2011 um 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 <agraf@suse.de>
Yup, prototype was incorrectly introduced in
13a9a0d3e253e272744b523e39642c9b6d564f4d (usb: move complete callback
to port ops).
Acked-by: Andreas Färber <andreas.faerber@web.de>
Fixes the warning for me.
Thanks,
Andreas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] USB: Fix build breakage in musb
2011-05-07 22:59 [Qemu-devel] [PATCH] USB: Fix build breakage in musb Alexander Graf
2011-05-08 15:40 ` Andreas Färber
@ 2011-05-08 15:54 ` Stefan Weil
2011-05-08 16:08 ` Stefan Weil
1 sibling, 1 reply; 6+ messages in thread
From: Stefan Weil @ 2011-05-08 15:54 UTC (permalink / raw)
To: Alexander Graf; +Cc: QEMU-devel Developers, Gerd Hoffmann
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 <agraf@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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] USB: Fix build breakage in musb
2011-05-08 15:54 ` Stefan Weil
@ 2011-05-08 16:08 ` Stefan Weil
2011-05-09 7:43 ` Gerd Hoffmann
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Weil @ 2011-05-08 16:08 UTC (permalink / raw)
To: Alexander Graf; +Cc: Andreas Färber, QEMU-devel Developers, Gerd Hoffmann
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 <agraf@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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] USB: Fix build breakage in musb
2011-05-08 16:08 ` Stefan Weil
@ 2011-05-09 7:43 ` Gerd Hoffmann
2011-05-09 9:05 ` Alexander Graf
0 siblings, 1 reply; 6+ messages in thread
From: Gerd Hoffmann @ 2011-05-09 7:43 UTC (permalink / raw)
To: Stefan Weil; +Cc: Andreas Färber, Alexander Graf, QEMU-devel Developers
Hi,
> Looking closer at file hw/usb-musb.c, I'd even recommend removing
> all 'inline' attributes there:
I'll do that.
/me wonders why the local test build worked just fine. Seems recent gcc
versions became pickier (running gcc 4.4).
cheers,
Gerd
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] USB: Fix build breakage in musb
2011-05-09 7:43 ` Gerd Hoffmann
@ 2011-05-09 9:05 ` Alexander Graf
0 siblings, 0 replies; 6+ messages in thread
From: Alexander Graf @ 2011-05-09 9:05 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: Andreas Färber, QEMU-devel Developers
On 09.05.2011, at 09:43, Gerd Hoffmann wrote:
> Hi,
>
>> Looking closer at file hw/usb-musb.c, I'd even recommend removing
>> all 'inline' attributes there:
>
> I'll do that.
>
> /me wonders why the local test build worked just fine. Seems recent gcc versions became pickier (running gcc 4.4).
Hrm - maybe your gcc was just configured differently. It's certainly not the version :). I did my test builds on:
agraf@toonie:~> gcc --version
gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-05-09 9:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-07 22:59 [Qemu-devel] [PATCH] USB: Fix build breakage in musb Alexander Graf
2011-05-08 15:40 ` Andreas Färber
2011-05-08 15:54 ` Stefan Weil
2011-05-08 16:08 ` Stefan Weil
2011-05-09 7:43 ` Gerd Hoffmann
2011-05-09 9:05 ` Alexander Graf
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).