hwmon: (dell-smm) Make fan/temp sensor number a u8
authorArmin Wolf <W_Armin@gmx.de>
Tue, 15 Feb 2022 19:11:09 +0000 (20:11 +0100)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 28 Feb 2022 01:03:19 +0000 (17:03 -0800)
commit4d9983dee5d4839008f7d1a75e866bccaa5877e8
treee0cb9774bae59d8b2e9c31a6d1fbadfe9aab68c2
parentec3db1ecf63e02265b4e93ddb1ba5cc6858c3972
hwmon: (dell-smm) Make fan/temp sensor number a u8

Right now, we only use bits 0 to 7 of the fan/temp sensor number
by doing number & 0xff. Passing the value as a u8 makes this
step unnecessary. Also add checks to the ioctl handler since
users might get confused when passing 0x00000101 does the same
as passing 0x00000001.

Tested on a Dell Inspiron 3505.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Pali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/20220215191113.16640-4-W_Armin@gmx.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/dell-smm-hwmon.c