From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tony Lindgren Subject: Re: [PATCH 1/6] usb: musb: Fix broken use of static variable for multiple instances Date: Fri, 11 Nov 2016 12:05:19 -0800 Message-ID: <20161111200519.GG7138@atomide.com> References: <20161111184302.2438-1-tony@atomide.com> <20161111184302.2438-2-tony@atomide.com> <20161111191430.GB17372@uda0271908> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20161111191430.GB17372@uda0271908> Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Bin Liu , Boris Brezillon , Greg Kroah-Hartman , Andreas Kemnade , Felipe Balbi , Kishon Vijay Abraham I , Ivaylo Dimitrov , Johan Hovold , Ladislav Michl , Laurent Pinchart , Sergei Shtylyov , linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-omap@vger.kernel.org * Bin Liu [161111 11:15]: > On Fri, Nov 11, 2016 at 10:42:57AM -0800, Tony Lindgren wrote: > > --- a/drivers/usb/musb/musb_core.h > > +++ b/drivers/usb/musb/musb_core.h > > @@ -385,6 +385,8 @@ struct musb { > > int a_wait_bcon; /* VBUS timeout in msecs */ > > unsigned long idle_timeout; /* Next timeout in jiffies */ > > > > + unsigned is_initialized:1; > > + > > The musb strcut is getting bigger and bigger. Is it possible to not add > a new variable but use one initialized in musb_init_controller() for > this flag purpose? Readability shouldn't be an issue, since it is only > used once in musb_runtime_resume(). Well I was initially checking for delayed work being initialized, but Johan did not like the idea of using it. Looking at musb_init_controller(), we only initialize musb->nIrq after pm_runtime_get_sync(), but that's no better either.. Do you have any better ideas for something to use? I agree in the long run we should split struct musb into smaller structs though. Meanwhile the new flags added in this series are bitfields, so it's probably better to use that and overloading something that's not strictly related. Regards, Tony -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html