Linux-IIO Archive on lore.kernel.org
 help / color / Atom feed
From: Joe Perches <joe@perches.com>
To: Jonathan Cameron <jic23@kernel.org>,
	Jacopo Mondi <jacopo+renesas@jmondi.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH 04/12] iio: adc: max9611: Fix misuse of GENMASK macro
Date: Sun, 14 Jul 2019 05:19:32 -0700
Message-ID: <b3744e64b22de98bfe8885f76811d4fc7e41b8eb.camel@perches.com> (raw)
In-Reply-To: <20190714125403.0789dc9e@archlinux>

On Sun, 2019-07-14 at 12:54 +0100, Jonathan Cameron wrote:
> On Tue,  9 Jul 2019 22:04:17 -0700
> Joe Perches <joe@perches.com> wrote:
> 
> > Arguments are supposed to be ordered high then low.
> > 
> > Signed-off-by: Joe Perches <joe@perches.com>
> 
> Applied to the fixes-togreg branch of iio.git and marked for
> stable etc.

This mask is used in an init function called from a probe.

I don't have this hardware but it looks as if it could
never have worked so I doubt the driver and the hardware
have ever been tested.

Does anyone have this device in actual use?


	regval = ret & MAX9611_TEMP_MASK;

	if ((regval > MAX9611_TEMP_MAX_POS &&
	     regval < MAX9611_TEMP_MIN_NEG) ||
	     regval > MAX9611_TEMP_MAX_NEG) {
		dev_err(max9611->dev,
			"Invalid value received from ADC 0x%4x: aborting\n",
			regval);
		return -EIO;
	}


> Thanks,
> 
> Jonathan
> 
> > ---
> >  drivers/iio/adc/max9611.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c
> > index 917223d5ff5b..0e3c6529fc4c 100644
> > --- a/drivers/iio/adc/max9611.c
> > +++ b/drivers/iio/adc/max9611.c
> > @@ -83,7 +83,7 @@
> >  #define MAX9611_TEMP_MAX_POS		0x7f80
> >  #define MAX9611_TEMP_MAX_NEG		0xff80
> >  #define MAX9611_TEMP_MIN_NEG		0xd980
> > -#define MAX9611_TEMP_MASK		GENMASK(7, 15)
> > +#define MAX9611_TEMP_MASK		GENMASK(15, 7)
> >  #define MAX9611_TEMP_SHIFT		0x07
> >  #define MAX9611_TEMP_RAW(_r)		((_r) >> MAX9611_TEMP_SHIFT)
> >  #define MAX9611_TEMP_SCALE_NUM		1000000


  reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190710050444epcas1p250f7aa0f8798a7757df51d66f5970c2a@epcas1p2.samsung.com>
2019-07-10  5:04 ` [PATCH 00/12] treewide: Fix GENMASK misuses Joe Perches
2019-07-10  5:04   ` [PATCH 04/12] iio: adc: max9611: Fix misuse of GENMASK macro Joe Perches
2019-07-14 11:54     ` Jonathan Cameron
2019-07-14 12:19       ` Joe Perches [this message]
2019-07-14 14:37         ` Jacopo Mondi
2019-07-10  9:17   ` [PATCH 00/12] treewide: Fix GENMASK misuses Johannes Berg
2019-07-10  9:43     ` Russell King - ARM Linux admin
2019-07-10 15:45       ` Joe Perches
2019-07-10 16:01         ` Joe Perches
2019-07-11 21:30   ` David Miller
2019-07-12 12:54   ` Andrzej Hajda

Reply instructions:

You may reply publically 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=b3744e64b22de98bfe8885f76811d4fc7e41b8eb.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=jacopo+renesas@jmondi.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 \
    /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

Linux-IIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iio/0 linux-iio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iio linux-iio/ https://lore.kernel.org/linux-iio \
		linux-iio@vger.kernel.org linux-iio@archiver.kernel.org
	public-inbox-index linux-iio


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-iio


AGPL code for this site: git clone https://public-inbox.org/ public-inbox