lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220419202051.44013-4-mosescb.dev@gmail.com>
Date:   Tue, 19 Apr 2022 22:20:51 +0200
From:   Moses Christopher Bollavarapu <mosescb.dev@...il.com>
To:     matt.ranostay@...sulko.com, mchehab@...nel.org,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     Moses Christopher Bollavarapu <mosescb.dev@...il.com>
Subject: [PATCH 3/3] media: i2c: video-i2c: Use GENMASK for masking bits

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

Signed-off-by: Moses Christopher Bollavarapu <mosescb.dev@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ