]> www.infradead.org Git - users/jedix/linux-maple.git/commit
hwmon: (core) Avoid ifdef CONFIG_THERMAL in C source file
authorThomas Weißschuh <linux@weissschuh.net>
Mon, 18 Nov 2024 06:15:59 +0000 (07:15 +0100)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 14 Dec 2024 16:00:44 +0000 (08:00 -0800)
commit4d2ffc42f78c429b7d42a635351a654c6f0b01b5
tree00edd0bc64d77750777bae40eab5831ae57bc3a7
parent868dc3cd1105bd328be864bf2c409891438df44a
hwmon: (core) Avoid ifdef CONFIG_THERMAL in C source file

Using an #ifdef in a C source files to have different definitions
of the same symbol makes the code harder to read and understand.
Furthermore it makes it harder to test compilation of the different
branches.

Replace the ifdeffery with IS_ENABLED() which is just a normal
conditional.
The resulting binary is still the same as before as the compiler
optimizes away all the unused code and definitions.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/hwmon.c