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

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

 



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

-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.
> 
> >
> >  		handled = IRQ_HANDLED;
> >  		musb->is_active = 1;
> 
> [1]
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-
> 2.6.git;a=commitdiff;h=aa4714560b4ea359bb7830188ebd06bce71bcdea
> 
> WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux