Re: [PATCH v3 01/10] usb: gadget: add anonymous definition in struct usb_gadget

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

 



On Wed, Sep 13, 2023 at 11:46:12AM +0800, Linyu Yuan wrote:
> but Alan Stern have one comment,   do it mean the bit position number is not
> expect and we can't use it ?
> 
> @Alan Stern ,  BIT(0), BIT(1) is not the member we expect ?

They might not be.  If you can avoid making this assumption, you should.

> > This macro usage is a real mess.  Can't you find a better way to do it?
> >
> > For instance, in the code that parses the trace buffer, define a
> > temporary usb_gadget structure and copy the dw1 field from the trace
> > buffer to the temporary structure.  Then you can access the fields in
> > that structure directly by their original names, with no macros.
> 
> do it same idea just move it outside of gadget.h ?

Keep the anonymous union in gadget.h, but get rid of the macros.

Alan Stern



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

  Powered by Linux