Re: [PATCH v4 2/3] usb: gadget: introduce gadget state tracking

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

 



On Fri, Jan 25, 2013 at 06:27:20PM +0200, Felipe Balbi wrote:
> On Fri, Jan 25, 2013 at 08:07:31AM -0800, Greg KH wrote:
> > On Fri, Jan 25, 2013 at 05:31:35PM +0200, Felipe Balbi wrote:
> > > Hi,
> > > 
> > > On Fri, Jan 25, 2013 at 10:27:24AM -0500, Alan Stern wrote:
> > > > On Fri, 25 Jan 2013, Felipe Balbi wrote:
> > > > 
> > > > > I guess it would be good to have a:
> > > > > 
> > > > > enum usb_gadget_state usb_gadget_get_state(struct usb_gadget *gadget)
> > > > > {
> > > > > 	return gadget->state;
> > > > > }
> > > > > 
> > > > > right ?? At least dwc3 can make use of it.
> > > > 
> > > > This seems like unnecessary embellishment.  What's wrong with typing
> > > > 
> > > > 	gadget->state
> > > > 
> > > > instead of
> > > > 
> > > > 	usb_gadget_get_state(gadget)
> > > > 
> > > > ?  Do you have some reason to think the "state" field will need further 
> > > > encapsulation in the future?
> > > 
> > > not really, just that a setter() usually follows up a getter(). But...
> > > meh... no strong feelings
> > 
> > I would argue that for something as simple as ->state, you don't even
> > need a "setter()" function.  This is C, not Java :)
> 
> hehe, the setter also does a sysfs notify ;-)

Ah, missed that.  Ok, that's fine :)

greg k-h
--
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