Messages in this thread Patch in this message | | | Date | Tue, 24 Nov 2015 15:28:45 -0800 | From | Greg KH <> | Subject | Re: [PATCH] drivers: staging: vme: Changed (1 << n) to BIT(n) |
| |
On Mon, Nov 09, 2015 at 08:03:18AM +0000, Martyn Welch wrote: > > On 8 Nov 2015 23:22, "Andy Shevchenko" <andy.shevchenko@gmail.com> wrote: > > > > On Sun, Nov 8, 2015 at 10:39 PM, Egor Uleyskiy <egor.ulieiskii@gmail.com> > wrote: > > > From: Egor Uleyskiy <egor.ulieiskii@gmail.com> > > > > > > Signed-off-by: Egor Uleyskiy <egor.ulieiskii@gmail.com> > > > --- > > > drivers/staging/vme/devices/vme_pio2.h | 93 > ++++++++++++++++------------------ > > > 1 file changed, 45 insertions(+), 48 deletions(-) > > > > > > diff --git a/drivers/staging/vme/devices/vme_pio2.h b/drivers/staging/vme/ > devices/vme_pio2.h > > > index d5d94c4..29d7a58 100644 > > > --- a/drivers/staging/vme/devices/vme_pio2.h > > > +++ b/drivers/staging/vme/devices/vme_pio2.h > > <snip> > > > > @@ -182,7 +181,7 @@ static const int PIO2_CNTR_CTRL[6] = { > PIO2_REGS_CTRL_WRD0, > > > PIO2_REGS_CTRL_WRD1 }; > > > > > > #define PIO2_CNTR_SC_DEV0 0 > > > -#define PIO2_CNTR_SC_DEV1 (1 << 6) > > > +#define PIO2_CNTR_SC_DEV1 BIT(6) > > > #define PIO2_CNTR_SC_DEV2 (2 << 6) > > > #define PIO2_CNTR_SC_RDBACK (3 << 6) > > > > With the first parts which are an excellent clean up, this one makes > > two styles out of one. > > Greg, what would you suggest to do? For my opinion in such cases > > direct values or previous syntax looks better. > > > > If BIT() can't be applied uniformly, I'm afraid I don't see the value in using > it. > > Has there been some general push to use BIT(x) rather than (1 << x) that I've > missed? > > I'm not sure how I feel about these macros, is there some advantage that I'm > missing?
It's easier to understand for the most part, so yes, it is good to do where it makes sense (hint, not for this last chunk...)
thanks,
greg k-h
| |