[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20151124232845.GC17422@kroah.com>
Date: Tue, 24 Nov 2015 15:28:45 -0800
From: Greg KH <gregkh@...uxfoundation.org>
To: Martyn Welch <martyn@...chs.me.uk>
Cc: Andy Shevchenko <andy.shevchenko@...il.com>,
Trivial Patch Monkey <trivial@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Manohar Vanga <manohar.vanga@...il.com>,
Egor Uleyskiy <egor.ulieiskii@...il.com>
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@...il.com> wrote:
> >
> > On Sun, Nov 8, 2015 at 10:39 PM, Egor Uleyskiy <egor.ulieiskii@...il.com>
> wrote:
> > > From: Egor Uleyskiy <egor.ulieiskii@...il.com>
> > >
> > > Signed-off-by: Egor Uleyskiy <egor.ulieiskii@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists