On 02/19/2017 09:00 PM, sayli karnik wrote: > Use GENMASK() macro for left shifting integers. > > Signed-off-by: sayli karnik <karniksayli1995@xxxxxxxxx> > --- > v2: > Used GENMASK() macro instead of BIT() macro for multi-bit bitfields. > Removed extra parentheses around argument to macro > > drivers/staging/iio/cdc/ad7152.c | 32 ++++++++++++++++---------------- > 1 file changed, 16 insertions(+), 16 deletions(-) > > diff --git a/drivers/staging/iio/cdc/ad7152.c b/drivers/staging/iio/cdc/ad7152.c > index e8609b8..ab94fad 100644 > --- a/drivers/staging/iio/cdc/ad7152.c > +++ b/drivers/staging/iio/cdc/ad7152.c > @@ -47,28 +47,28 @@ > #define AD7152_STATUS_PWDN BIT(7) > > /* Setup Register Bit Designations (AD7152_REG_CHx_SETUP) */ > -#define AD7152_SETUP_CAPDIFF (1 << 5) > [...] > +#define AD7152_SETUP_CAPDIFF GENMASK(1, 5) This was actually right, the first time, CAPDIFF is a single bit bitfield, so it should use BIT(). > [...] > -#define AD7152_CONF_CH2EN (1 << 3) > -#define AD7152_CONF_CH1EN (1 << 4) > [...] > +#define AD7152_CONF_CH2EN GENMASK(1, 3) > +#define AD7152_CONF_CH1EN GENMASK(1, 4) Same here CH2EN and CH1EN are single bit bitfields. > /* Capdac Register Bit Designations (AD7152_REG_CAPDAC_XXX) */ > -#define AD7152_CAPDAC_DACEN (1 << 7) > [...] > +#define AD7152_CAPDAC_DACEN GENMASK(1, 7) Same for DACEN. -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html