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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 17 Jun 2019 08:12:30 +0000
From:   <Amy.Shih@...antech.com.tw>
To:     <she90122@...il.com>
CC:     <amy.shih@...antech.com.tw>, <oakley.ding@...antech.com.tw>,
        <jia.sui@...antech.com.cn>, Jean Delvare <jdelvare@...e.com>,
        Guenter Roeck <linux@...ck-us.net>,
        <linux-hwmon@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [v2 5/9] hwmon: (nct7904) Fix incorrect register bit mapping of temperature alarm.

From: "amy.shih" <amy.shih@...antech.com.tw>

In function nct7904_read_temp, the bit to shift for register
SMI_STS1_REG should be bit 1 & 3 & 5 &7 for TEMP_CH1~4.

Signed-off-by: amy.shih <amy.shih@...antech.com.tw>
---
Changes in v2:
- Fix incorrect register bit mapping of temperature alarm.

 drivers/hwmon/nct7904.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/nct7904.c b/drivers/hwmon/nct7904.c
index 402c1bb2a99f..95348eebe8e4 100644
--- a/drivers/hwmon/nct7904.c
+++ b/drivers/hwmon/nct7904.c
@@ -356,7 +356,7 @@ static int nct7904_read_temp(struct device *dev, u32 attr, int channel,
 					       SMI_STS1_REG);
 			if (ret < 0)
 				return ret;
-			*val = (ret >> (channel & 0x07)) & 1;
+			*val = (ret >> (((channel * 2) + 1) & 0x07)) & 1;
 		} else {
 			if ((channel - 5) < 4) {
 				ret = nct7904_read_reg(data, BANK_0,
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ