Re: [PATCH 3/8] musb: fix compilation warning in host only mode

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

 



Gupta, Ajay Kumar wrote:

Fixes below compilation warning when host only configuration is
selected.

drivers/usb/musb/musb_core.c: In function 'musb_stage0_irq':
drivers/usb/musb/musb_core.c:711: warning: unused variable 'mbase'
Also removed definition of 'mbase' from multiple places to only
at function top.

    AFAIR, it was intentionally removed from the function top and declared
in the multiple plcase instead by the former Felipe's patch [1] to fix
exactly the same issue, if I don't mistake. So, it hasn't worked out?

Yes, it was removed by Felipe's below patch but it introduced
compilation warning issue as reported.

---------------
commit aa4714560b4ea359bb7830188ebd06bce71bcdea
usb: musb: core: declare mbase only where it's used

... and avoid a compilation if we disable host side
of musb.
--------------

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@xxxxxx>
[...]
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index f0ff893..7cc8398 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -455,6 +455,9 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
 				u8 devctl, u8 power)
 {
 	irqreturn_t handled = IRQ_NONE;
+#ifdef CONFIG_USB_MUSB_HDRC_HCD
+	void __iomem	*mbase = musb->mregs;
+#endif

    I'd rather see it declared multiple times...

I was thinking it's better to have it at one place and avoid multiple
#ifdefs.

You'd only need one #ifdef: in the placae where the warning was reported. And you can open a block under #ifdef CONFIG_USB_MUSB_OTG to declare it in. Other declarations are already covered by #ifdef's, aren't they?

-Ajay
@@ -703,7 +700,6 @@ static irqreturn_t musb_stage0_irq(struct musb
*musb, u8 int_usb,
 	if (int_usb & MUSB_INTR_CONNECT) {
 		struct usb_hcd *hcd = musb_to_hcd(musb);
-		void __iomem *mbase = musb->mregs;

    We could also move this into the #ifdef CONFIG_USB_MUSB_OTG block.

   Yeah, the block where 'mbase' is actually used.

BTW, your patch didn't cover the declaration in #if 0'ed out SOF handler.

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux