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

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

 



> >>     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?

Here is the version-2 of this patch.

--------------- cut here -------------------
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'

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@xxxxxx>
---
 drivers/usb/musb/musb_core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index a8b0440..cfae447 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -704,7 +704,9 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
 #ifdef CONFIG_USB_MUSB_HDRC_HCD
 	if (int_usb & MUSB_INTR_CONNECT) {
 		struct usb_hcd *hcd = musb_to_hcd(musb);
+#ifdef CONFIG_USB_MUSB_OTG
 		void __iomem *mbase = musb->mregs;
+#endif
 
 		handled = IRQ_HANDLED;
 		musb->is_active = 1;
-- 
1.6.2.4
--------------------------------------------


Thanks,
Ajay
> 
> > -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