Skip to content

Commit 2dd1d86

Browse files
thekhalifagroeck
authored andcommitted
hwmon: (nct6775) Fix non-existent ALARM warning
Skip non-existent ALARM attribute to avoid a shift-out-of-bounds dmesg warning. Reported-by: Doug Smythies <[email protected]> Closes: https://lore.kernel.org/linux-hwmon/[email protected]/T/#mc69b690660eb50734a6b07506d74a119e0266f1b Fixes: b7f1f7b ("hwmon: (nct6775) Additional TEMP registers for nct6799") Signed-off-by: Ahmad Khalifa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 0bb80ec commit 2dd1d86

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/hwmon/nct6775-core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1910,6 +1910,10 @@ static umode_t nct6775_in_is_visible(struct kobject *kobj,
19101910
struct device *dev = kobj_to_dev(kobj);
19111911
struct nct6775_data *data = dev_get_drvdata(dev);
19121912
int in = index / 5; /* voltage index */
1913+
int nr = index % 5; /* attribute index */
1914+
1915+
if (nr == 1 && data->ALARM_BITS[in] == -1)
1916+
return 0;
19131917

19141918
if (!(data->have_in & BIT(in)))
19151919
return 0;

0 commit comments

Comments
 (0)