From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJ6Wi-0001qg-3y for qemu-devel@nongnu.org; Sun, 08 May 2011 12:08:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJ6Wh-00086F-AI for qemu-devel@nongnu.org; Sun, 08 May 2011 12:08:12 -0400 Received: from moutng.kundenserver.de ([212.227.17.8]:56564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJ6Wg-00086B-VJ for qemu-devel@nongnu.org; Sun, 08 May 2011 12:08:11 -0400 Message-ID: <4DC6BFE3.7020204@mail.berlios.de> Date: Sun, 08 May 2011 18:08:03 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1304809179-7359-1-git-send-email-agraf@suse.de> <4DC6BCC2.4020108@mail.berlios.de> In-Reply-To: <4DC6BCC2.4020108@mail.berlios.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] USB: Fix build breakage in musb List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: =?ISO-8859-15?Q?Andreas_F=E4rber?= , 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 >> --- >> 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.