linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Sumit Pundir <pundirsumit11@gmail.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	<linux-iio@vger.kernel.org>, <devel@driverdev.osuosl.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Staging: iio: Prefer using BIT macro
Date: Mon, 8 Jan 2018 11:32:37 +0000	[thread overview]
Message-ID: <20180108113237.0000080d@huawei.com> (raw)
In-Reply-To: <CAHp75VfFh9mrF1xPfnspJ=cWs=URFrF2sjdbBMV-p36-AjkcKA@mail.gmail.com>

On Mon, 8 Jan 2018 01:30:29 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Sat, Jan 6, 2018 at 2:42 PM, Jonathan Cameron <jic23@kernel.org> wrote:
> > On Thu,  4 Jan 2018 22:06:31 +0530  
> 
> >>  /* Setup Register Bit Designations (AD7152_REG_CHx_SETUP) */
> >> -#define AD7152_SETUP_CAPDIFF         (1 << 5)
> >> +#define AD7152_SETUP_CAPDIFF         BIT(5)  
> >
> > This is indeed a 1 bit field so fine.  
> 
> But shouldn't we prevent style over the module? Otherwise it might be
> hard to decode one field from the other because of style differences.

I'm not sure using BIT for single bit fields really makes it much harder
to read, but perhaps you are right.  Anyhow, can't say I feel strongly
about this one either way!

Jonathan

> 
> >>  #define AD7152_SETUP_RANGE_2pF               (0 << 6)
> >> -#define AD7152_SETUP_RANGE_0_5pF     (1 << 6)
> >> +#define AD7152_SETUP_RANGE_0_5pF     BIT(6)  
> > This is clearly putting the value 1 in a 2 bit field within
> > the register - BIT macro obscures this compeltely.  
> 

      reply	other threads:[~2018-01-08 11:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04 16:36 [PATCH] Staging: iio: Prefer using BIT macro Sumit Pundir
2018-01-06 12:42 ` Jonathan Cameron
2018-01-06 13:33   ` Sumit Pundir
2018-01-07 23:30   ` Andy Shevchenko
2018-01-08 11:32     ` Jonathan Cameron [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=20180108113237.0000080d@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=pundirsumit11@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).