All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antoine Tenart <antoine.tenart@free-electrons.com>
To: Hartmut Knaack <knaack.h@gmx.de>
Cc: linux-iio@vger.kernel.org, Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	Antoine Tenart <antoine.tenart@free-electrons.com>
Subject: Re: [PATCH v2 3/8] iio:adc:berlin2-adc: use GENMASK and BIT for masks
Date: Thu, 30 Jul 2015 14:47:43 +0200	[thread overview]
Message-ID: <20150730124743.GB16416@kwain> (raw)
In-Reply-To: <1e5a908f364c1fb18982be097ac83689820d64a8.1438035998.git.knaack.h@gmx.de>

On Tue, Jul 28, 2015 at 12:38:59AM +0200, Hartmut Knaack wrote:
> Make use of GENMASK for consecutive bitmasks and BIT for single bitmasks.
> 
> Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>

Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>

> ---
>  drivers/iio/adc/berlin2-adc.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/adc/berlin2-adc.c b/drivers/iio/adc/berlin2-adc.c
> index b31bcf4c7c90..ed31a0a8d78e 100644
> --- a/drivers/iio/adc/berlin2-adc.c
> +++ b/drivers/iio/adc/berlin2-adc.c
> @@ -27,13 +27,13 @@
>  #define  BERLIN2_SM_CTRL_SM_SOC_INT		BIT(1)
>  #define  BERLIN2_SM_CTRL_SOC_SM_INT		BIT(2)
>  #define  BERLIN2_SM_CTRL_ADC_SEL(x)		((x) << 5)	/* 0-15 */
> -#define  BERLIN2_SM_CTRL_ADC_SEL_MASK		(0xf << 5)
> +#define  BERLIN2_SM_CTRL_ADC_SEL_MASK		GENMASK(8, 5)
>  #define  BERLIN2_SM_CTRL_ADC_POWER		BIT(9)
>  #define  BERLIN2_SM_CTRL_ADC_CLKSEL_DIV2	(0x0 << 10)
>  #define  BERLIN2_SM_CTRL_ADC_CLKSEL_DIV3	(0x1 << 10)
>  #define  BERLIN2_SM_CTRL_ADC_CLKSEL_DIV4	(0x2 << 10)
>  #define  BERLIN2_SM_CTRL_ADC_CLKSEL_DIV8	(0x3 << 10)
> -#define  BERLIN2_SM_CTRL_ADC_CLKSEL_MASK	(0x3 << 10)
> +#define  BERLIN2_SM_CTRL_ADC_CLKSEL_MASK	GENMASK(11, 10)
>  #define  BERLIN2_SM_CTRL_ADC_START		BIT(12)
>  #define  BERLIN2_SM_CTRL_ADC_RESET		BIT(13)
>  #define  BERLIN2_SM_CTRL_ADC_BANDGAP_RDY	BIT(14)
> @@ -50,7 +50,7 @@
>  #define  BERLIN2_SM_CTRL_TSEN_MODE_10_50	(0x1 << 22)	/* 10-50 C */
>  #define  BERLIN2_SM_CTRL_TSEN_RESET		BIT(29)
>  #define BERLIN2_SM_ADC_DATA			0x20
> -#define  BERLIN2_SM_ADC_MASK			0x3ff
> +#define  BERLIN2_SM_ADC_MASK			GENMASK(9, 0)
>  #define BERLIN2_SM_ADC_STATUS			0x1c
>  #define  BERLIN2_SM_ADC_STATUS_DATA_RDY(x)	BIT(x)		/* 0-15 */
>  #define  BERLIN2_SM_ADC_STATUS_DATA_RDY_MASK	GENMASK(15, 0)
> @@ -65,9 +65,9 @@
>  #define  BERLIN2_SM_TSEN_CTRL_START		BIT(8)
>  #define  BERLIN2_SM_TSEN_CTRL_SETTLING_4	(0x0 << 21)	/* 4 us */
>  #define  BERLIN2_SM_TSEN_CTRL_SETTLING_12	(0x1 << 21)	/* 12 us */
> -#define  BERLIN2_SM_TSEN_CTRL_SETTLING_MASK	(0x1 << 21)
> +#define  BERLIN2_SM_TSEN_CTRL_SETTLING_MASK	BIT(21)
>  #define  BERLIN2_SM_TSEN_CTRL_TRIM(x)		((x) << 22)
> -#define  BERLIN2_SM_TSEN_CTRL_TRIM_MASK		(0xf << 22)
> +#define  BERLIN2_SM_TSEN_CTRL_TRIM_MASK		GENMASK(25, 22)
>  
>  struct berlin2_adc_priv {
>  	struct regmap		*regmap;
> -- 
> 2.4.6
> 

-- 
Antoine Ténart, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2015-07-30 12:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 22:38 [PATCH v2 0/8] berlin2-adc fixes and cleanup Hartmut Knaack
2015-07-27 22:38 ` [PATCH v2 1/8] iio:adc:berlin2-adc: Fix register definition Hartmut Knaack
2015-07-30 12:47   ` Antoine Tenart
2015-08-02 17:59     ` Jonathan Cameron
2015-07-27 22:38 ` [PATCH v2 2/8] iio:adc:berlin2-adc: pass up real error code Hartmut Knaack
2015-08-02 18:06   ` Jonathan Cameron
2015-07-27 22:38 ` [PATCH v2 3/8] iio:adc:berlin2-adc: use GENMASK and BIT for masks Hartmut Knaack
2015-07-30 12:47   ` Antoine Tenart [this message]
2015-08-02 18:07     ` Jonathan Cameron
2015-08-12 21:11     ` Jonathan Cameron
2015-07-27 22:39 ` [PATCH v2 4/8] iio:adc:berlin2-adc: constify iio_chan_spec Hartmut Knaack
2015-08-02 18:07   ` Jonathan Cameron
2015-07-27 22:39 ` [PATCH v2 5/8] iio:adc:berlin2-adc: use short operator format Hartmut Knaack
2015-08-02 18:08   ` Jonathan Cameron
2015-07-27 22:39 ` [PATCH v2 6/8] iio:adc:berlin2-adc: use channel-array size directly Hartmut Knaack
2015-08-02 18:09   ` Jonathan Cameron
2015-07-27 22:39 ` [PATCH v2 7/8] iio:adc:berlin2-adc: enable interrupts with mutex locked Hartmut Knaack
2015-07-31 23:54   ` Hartmut Knaack
2015-08-12 21:13     ` Jonathan Cameron
2015-08-17 12:57       ` Antoine Tenart
2015-07-27 22:39 ` [PATCH v2 8/8] iio:adc:berlin2-adc: coding style cleanup Hartmut Knaack
2015-08-12 21:14   ` Jonathan Cameron

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=20150730124743.GB16416@kwain \
    --to=antoine.tenart@free-electrons.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.