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