iio: adc: max9611: Fix misuse of GENMASK macro [Linux 4.14.139]

This Linux kernel change "iio: adc: max9611: Fix misuse of GENMASK macro" is included in the Linux 4.14.139 release. This change is authored by Joe Perches <joe [at] perches.com> on Tue Jul 9 22:04:17 2019 -0700. The commit for this change in Linux stable tree is 9af2233 (patch) which is from upstream commit ae8cc91. The same Linux upstream change may have been applied to various maintained Linux releases and you can find all Linux releases containing changes from upstream ae8cc91.

iio: adc: max9611: Fix misuse of GENMASK macro

commit ae8cc91a7d85e018c0c267f580820b2bb558cd48 upstream.

Arguments are supposed to be ordered high then low.

Signed-off-by: Joe Perches <joe@perches.com>
Fixes: 69780a3bbc0b ("iio: adc: Add Maxim max9611 ADC driver")
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 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 b1dd17c..f8f298c 100644
--- a/drivers/iio/adc/max9611.c
+++ b/drivers/iio/adc/max9611.c
@@ -86,7 +86,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

Leave a Reply

Your email address will not be published. Required fields are marked *