diff mbox series

[v2,1/1] hwmon: nct7802: Fix for temp6 (PECI1) processed even if PECI1 disabled

Message ID DU0PR10MB62526435ADBC6A85243B90E08002A@DU0PR10MB6252.EURPRD10.PROD.OUTLOOK.COM (mailing list archive)
State Accepted
Headers show
Series [v2,1/1] hwmon: nct7802: Fix for temp6 (PECI1) processed even if PECI1 disabled | expand

Commit Message

Gilles Buloz July 24, 2023, 8:04 a.m. UTC
Because of hex value 0x46 used instead of decimal 46, the temp6
(PECI1) temperature is always declared visible and then displayed
even if disabled in the chip

Signed-off-by: Gilles Buloz <gilles.buloz@kontron.com>
---
V2 :
- Same patch resent with another mailer because context lines were
  corrupted by extra spaces
---
 drivers/hwmon/nct7802.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guenter Roeck July 24, 2023, 2:06 p.m. UTC | #1
On Mon, Jul 24, 2023 at 08:04:44AM +0000, Gilles Buloz wrote:
> Because of hex value 0x46 used instead of decimal 46, the temp6
> (PECI1) temperature is always declared visible and then displayed
> even if disabled in the chip
> 
> Signed-off-by: Gilles Buloz <gilles.buloz@kontron.com>
> ---
> V2 :
> - Same patch resent with another mailer because context lines were
>   corrupted by extra spaces

I wondered where that was coming from. Thanks for figuring it out.
Applied.

On a side note, I still see

CHECK: From:/Signed-off-by: email comments mismatch:
    'From: Gilles Buloz <Gilles.Buloz@kontron.com>' != 'Signed-off-by: Gilles Buloz <gilles.buloz@kontron.com>'
                         ^      ^                                                    ^      ^

Thanks,
Guenter
diff mbox series

Patch

diff --git a/drivers/hwmon/nct7802.c b/drivers/hwmon/nct7802.c
index 9339bfc..024cff1 100644
--- a/drivers/hwmon/nct7802.c
+++ b/drivers/hwmon/nct7802.c
@@ -725,7 +725,7 @@  static umode_t nct7802_temp_is_visible(struct kobject *kobj,
 	if (index >= 38 && index < 46 && !(reg & 0x01))		/* PECI 0 */
 		return 0;
 
-	if (index >= 0x46 && (!(reg & 0x02)))			/* PECI 1 */
+	if (index >= 46 && !(reg & 0x02))			/* PECI 1 */
 		return 0;
 
 	return attr->mode;