Re: [Patch V6 7/8] usb: gadget: Add UDC driver for tegra XUSB device mode controller

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

 



On Mon, 2019-08-12 at 15:49 +0300, Felipe Balbi wrote:
> Hi,
> 
> Chunfeng Yun <chunfeng.yun@xxxxxxxxxxxx> writes:
> >> +/* XUSB_DEV registers */
> >> +#define SPARAM 0x000
> >> +#define  SPARAM_ERSTMAX_SHIFT 16
> >> +#define  SPARAM_ERSTMAX_MASK GENMASK(4, 0)
> >> +#define DB 0x004
> >> +#define  DB_TARGET_SHIFT 8
> >> +#define  DB_TARGET_MASK GENMASK(7, 0)
> >> +#define  DB_STREAMID_SHIFT 16
> >> +#define  DB_STREAMID_MASK GENMASK(15, 0)
> > To me, define it as :
> > #define  DB_STREAMID_MASK GENMASK(31, 16),
> > it's more clearer.
> > and define another macro
> > #define  DB_STREAMID(x) (((x) & 0xffff) << 16)
> 
> perhaps?
> 
> #define DB_STREAMID(x)	(((x) << 16) & DB_STREAMID_MASK)
It's a better way :)

> 
> Otherwise you end up defining the mask twice.
> 





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux