public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Martyn Welch <martyn@welchs.me.uk>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Trivial Patch Monkey <trivial@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Manohar Vanga <manohar.vanga@gmail.com>,
	Egor Uleyskiy <egor.ulieiskii@gmail.com>
Subject: Re: [PATCH] drivers: staging: vme: Changed (1 << n) to BIT(n)
Date: Tue, 24 Nov 2015 15:28:45 -0800	[thread overview]
Message-ID: <20151124232845.GC17422@kroah.com> (raw)
In-Reply-To: <CAEccXefJK9PE73B2njX-on0RWKZbiOk-ARwJe8V1xLHP1i0FAQ@mail.gmail.com>

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

      parent reply	other threads:[~2015-11-24 23:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-08 20:39 [PATCH] drivers: staging: vme: Changed (1 << n) to BIT(n) Egor Uleyskiy
2015-11-08 21:43 ` Andy Shevchenko
2015-11-24 23:28   ` Greg Kroah-Hartman
     [not found]   ` <CAEccXefJK9PE73B2njX-on0RWKZbiOk-ARwJe8V1xLHP1i0FAQ@mail.gmail.com>
2015-11-24 23:28     ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151124232845.GC17422@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=egor.ulieiskii@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manohar.vanga@gmail.com \
    --cc=martyn@welchs.me.uk \
    --cc=trivial@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox