public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Moses Christopher Bollavarapu <mosescb.dev@gmail.com>
To: matt.ranostay@konsulko.com, mchehab@kernel.org,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Moses Christopher Bollavarapu <mosescb.dev@gmail.com>
Subject: [PATCH 3/3] media: i2c: video-i2c: Use GENMASK for masking bits
Date: Tue, 19 Apr 2022 22:20:51 +0200	[thread overview]
Message-ID: <20220419202051.44013-4-mosescb.dev@gmail.com> (raw)
In-Reply-To: <20220419202051.44013-1-mosescb.dev@gmail.com>

Replace 0x0380 with GENMASK(9, 7) to obtain 0b0000_0011_1000_0000

Signed-off-by: Moses Christopher Bollavarapu <mosescb.dev@gmail.com>
---
 drivers/media/i2c/video-i2c.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c
index 1d5f48329cb2..e08e3579c0a1 100644
--- a/drivers/media/i2c/video-i2c.c
+++ b/drivers/media/i2c/video-i2c.c
@@ -9,6 +9,7 @@
  * - Melexis MLX90640 Thermal Cameras
  */
 
+#include <linux/bits.h>
 #include <linux/delay.h>
 #include <linux/freezer.h>
 #include <linux/hwmon.h>
@@ -62,7 +63,7 @@
 
 /* Control register */
 #define MLX90640_REG_CTL1		0x800d
-#define MLX90640_REG_CTL1_MASK		0x0380
+#define MLX90640_REG_CTL1_MASK		GENMASK(9, 7)
 #define MLX90640_REG_CTL1_MASK_SHIFT	7
 
 struct video_i2c_chip;
-- 
2.30.2


      parent reply	other threads:[~2022-04-19 20:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 20:20 [PATCH 0/3] media: i2c: video-i2c: Minor corrections Moses Christopher Bollavarapu
2022-04-19 20:20 ` [PATCH 1/3] media: i2c: video-i2c: Move defines to the top of the file Moses Christopher Bollavarapu
2022-04-19 20:20 ` [PATCH 2/3] media: i2c: video-i2c: Replace constants with proper names Moses Christopher Bollavarapu
2022-04-19 20:20 ` Moses Christopher Bollavarapu [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=20220419202051.44013-4-mosescb.dev@gmail.com \
    --to=mosescb.dev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=matt.ranostay@konsulko.com \
    --cc=mchehab@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