# Error in nct7802.c

1 messages from 2025-09-03 to 2025-09-03. Participants: Латышев Сергей Александрович.
Thread: https://gitlist.dev/t/64081

## Латышев Сергей Александрович, 2025-09-03 12:59

Subject: Error in nct7802.c
Message-ID: <9e0ae524-096f-4629-b3bd-5a100f6790ef@nic-t.ru>
URL: https://gitlist.dev/e/9e0ae524-096f-4629-b3bd-5a100f6790ef%40nic-t.ru

```
Hello,
An error was found in the code of the drivers/hwmon/nct7802.c file.
A macro mismatch on line 49
#define SMARTFI_EN_SHIFT(x) ((x) %2 *4)
of the chip documentation dated 02.2020 in Table No. 7.2.95 "Temperature 
to Fan mapping Relationships Register".

I suggest this simple variant:
#define SMARTFI_EN_SHIFT(x) (((x)==0)?0:(((x)==1)?5:2))

```
