* [RFC PATCH] hwmon: remove tautological dependency expressions from Kconfig
@ 2026-07-29 21:54 Laszlo Ersek
2026-07-29 21:59 ` sashiko-bot
2026-07-30 2:54 ` Guenter Roeck
0 siblings, 2 replies; 3+ messages in thread
From: Laszlo Ersek @ 2026-07-29 21:54 UTC (permalink / raw)
To: laszlo.ersek
Cc: Andrew Jeffery, Cristian Marussi, Guenter Roeck, Heiko Stuebner,
Joel Stanley, Sudeep Holla, arm-scmi, linux-arm-kernel,
linux-aspeed, linux-hwmon, linux-kernel
Commit 554b3529fe01 ("thermal/drivers/core: Remove the module Kconfig's
option") [1] obviated some of the "Optional dependencies" (as described in
"Documentation/kbuild/kconfig-language.rst") in "drivers/hwmon/Kconfig".
Namely, said commit restricted the valid/possible subset of the full
Cartesian product "CONFIG_THERMAL x CONFIG_THERMAL_OF" to
{ (n, n), (y, n), (y, y) }
through "drivers/thermal/Kconfig". Numerically (using tristate values),
this set can be expressed as:
{ (0, 0), (2, 0), (2, 2) }
Over this set, the "drivers/hwmon/Kconfig" tristate expression
THERMAL || !THERMAL_OF
or equivalently,
max(THERMAL, 2-THERMAL_OF)
invariably evaluates to "y" (2).
Similarly, with THERMAL having been restricted to
{ n, y }
or numerically,
{ 0, 2 }
the "drivers/hwmon/Kconfig" tristate expression
THERMAL || THERMAL=n
or equivalently,
max(THERMAL, THERMAL=0)
invariably evaluates to "y" (2). (Note that "THERMAL=0" returns either "y"
(2) or "n" (0).)
Commit f37353320ee9 ("hwmon/drivers/core: Simplify complex dependency")
[2], which is the final commit of the series that [1] is the beginning of,
cleaned up the hwmon C source code in fact; however, it missed the
now-collapsed dependencies in Kconfig. At the time of [2], six of today's
such dependencies were present in Kconfig. Since then, two more have been
added (such that they persist, anyway): one by commit 4f8d374b770a
("hwmon: (max6650) add thermal cooling device capability"), which was
independent of the above-noted series, and another by commit 9855caf5d4eb
("hwmon: add driver for the hwmon parts of qnap-mcu devices"), which was a
descendant of the series.
Remove these always-"y" dependencies.
Cc: Andrew Jeffery <andrew@codeconstruct.com.au>
Cc: Cristian Marussi <cristian.marussi@arm.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Joel Stanley <joel@jms.id.au>
Cc: Sudeep Holla <sudeep.holla@kernel.org>
Cc: arm-scmi@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-aspeed@lists.ozlabs.org
Cc: linux-hwmon@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Laszlo Ersek <laszlo.ersek@arm.com>
---
Notes:
Untested (hence RFC) -- I don't know how to regression-test this patch
comprehensively yet minimally.
drivers/hwmon/Kconfig | 8 --------
1 file changed, 8 deletions(-)
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 2bfbcc033d59..d3a9c8a3a79c 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -403,7 +403,6 @@ config SENSORS_ARCTIC_FAN_CONTROLLER
config SENSORS_ARM_SCMI
tristate "ARM SCMI Sensors"
depends on ARM_SCMI_PROTOCOL
- depends on THERMAL || !THERMAL_OF
help
This driver provides support for temperature, voltage, current
and power sensors available on SCMI based platforms. The actual
@@ -415,7 +414,6 @@ config SENSORS_ARM_SCMI
config SENSORS_ARM_SCPI
tristate "ARM SCPI Sensors"
depends on ARM_SCPI_PROTOCOL
- depends on THERMAL || !THERMAL_OF
help
This driver provides support for temperature, voltage, current
and power sensors available on ARM Ltd's SCP based platforms. The
@@ -435,7 +433,6 @@ config SENSORS_ASB100
config SENSORS_ASPEED
tristate "ASPEED AST2400/AST2500 PWM and Fan tach driver"
depends on ARCH_ASPEED || COMPILE_TEST
- depends on THERMAL || THERMAL=n
select REGMAP
help
This driver provides support for ASPEED AST2400/AST2500 PWM
@@ -788,7 +785,6 @@ config SENSORS_G762
config SENSORS_GPIO_FAN
tristate "GPIO fan"
depends on GPIOLIB || COMPILE_TEST
- depends on THERMAL || THERMAL=n
help
If you say yes here you get support for fans connected to GPIO lines.
@@ -1357,7 +1353,6 @@ config SENSORS_MAX6639
config SENSORS_MAX6650
tristate "Maxim MAX6650 sensor chip"
depends on I2C
- depends on THERMAL || THERMAL=n
help
If you say yes here you get support for the MAX6650 / MAX6651
sensor chips.
@@ -1732,7 +1727,6 @@ config SENSORS_PC87427
config SENSORS_NTC_THERMISTOR
tristate "NTC thermistor support"
depends on IIO
- depends on THERMAL || !THERMAL_OF
help
This driver supports NTC thermistors sensor reading and its
interpretation. The driver can also monitor the temperature and
@@ -1933,7 +1927,6 @@ config SENSORS_PT5161L
config SENSORS_PWM_FAN
tristate "PWM fan"
depends on PWM || COMPILE_TEST
- depends on THERMAL || THERMAL=n
help
If you say yes here you get support for fans connected to PWM lines.
The driver uses the generic PWM interface, thus it will work on a
@@ -1945,7 +1938,6 @@ config SENSORS_PWM_FAN
config SENSORS_QNAP_MCU_HWMON
tristate "QNAP MCU hardware monitoring"
depends on MFD_QNAP_MCU
- depends on THERMAL || THERMAL=n
help
Say yes here to enable support for fan and temperature sensor
connected to a QNAP MCU, as found in a number of QNAP network
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] hwmon: remove tautological dependency expressions from Kconfig
2026-07-29 21:54 [RFC PATCH] hwmon: remove tautological dependency expressions from Kconfig Laszlo Ersek
@ 2026-07-29 21:59 ` sashiko-bot
2026-07-30 2:54 ` Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-07-29 21:59 UTC (permalink / raw)
To: Laszlo Ersek; +Cc: linux-hwmon
> Commit 554b3529fe01 ("thermal/drivers/core: Remove the module Kconfig's
> option") [1] obviated some of the "Optional dependencies" (as described in
> "Documentation/kbuild/kconfig-language.rst") in "drivers/hwmon/Kconfig".
>
> Namely, said commit restricted the valid/possible subset of the full
> Cartesian product "CONFIG_THERMAL x CONFIG_THERMAL_OF" to
>
> { (n, n), (y, n), (y, y) }
>
> through "drivers/thermal/Kconfig". Numerically (using tristate values),
> this set can be expressed as:
>
> { (0, 0), (2, 0), (2, 2) }
>
> Over this set, the "drivers/hwmon/Kconfig" tristate expression
> [ ... ]
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-aspeed@lists.ozlabs.org
> Cc: linux-hwmon@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Laszlo Ersek <laszlo.ersek@arm.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260729215436.2103380-1-laszlo.ersek@arm.com?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] hwmon: remove tautological dependency expressions from Kconfig
2026-07-29 21:54 [RFC PATCH] hwmon: remove tautological dependency expressions from Kconfig Laszlo Ersek
2026-07-29 21:59 ` sashiko-bot
@ 2026-07-30 2:54 ` Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2026-07-30 2:54 UTC (permalink / raw)
To: Laszlo Ersek
Cc: Andrew Jeffery, Cristian Marussi, Heiko Stuebner, Joel Stanley,
Sudeep Holla, arm-scmi, linux-arm-kernel, linux-aspeed,
linux-hwmon, linux-kernel
On 7/29/26 14:54, Laszlo Ersek wrote:
> Commit 554b3529fe01 ("thermal/drivers/core: Remove the module Kconfig's
> option") [1] obviated some of the "Optional dependencies" (as described in
> "Documentation/kbuild/kconfig-language.rst") in "drivers/hwmon/Kconfig".
>
> Namely, said commit restricted the valid/possible subset of the full
> Cartesian product "CONFIG_THERMAL x CONFIG_THERMAL_OF" to
>
> { (n, n), (y, n), (y, y) }
>
> through "drivers/thermal/Kconfig". Numerically (using tristate values),
> this set can be expressed as:
>
> { (0, 0), (2, 0), (2, 2) }
>
> Over this set, the "drivers/hwmon/Kconfig" tristate expression
>
> THERMAL || !THERMAL_OF
>
> or equivalently,
>
> max(THERMAL, 2-THERMAL_OF)
>
> invariably evaluates to "y" (2).
>
> Similarly, with THERMAL having been restricted to
>
> { n, y }
>
> or numerically,
>
> { 0, 2 }
>
> the "drivers/hwmon/Kconfig" tristate expression
>
> THERMAL || THERMAL=n
>
> or equivalently,
>
> max(THERMAL, THERMAL=0)
>
> invariably evaluates to "y" (2). (Note that "THERMAL=0" returns either "y"
> (2) or "n" (0).)
>
> Commit f37353320ee9 ("hwmon/drivers/core: Simplify complex dependency")
> [2], which is the final commit of the series that [1] is the beginning of,
> cleaned up the hwmon C source code in fact; however, it missed the
> now-collapsed dependencies in Kconfig. At the time of [2], six of today's
> such dependencies were present in Kconfig. Since then, two more have been
> added (such that they persist, anyway): one by commit 4f8d374b770a
> ("hwmon: (max6650) add thermal cooling device capability"), which was
> independent of the above-noted series, and another by commit 9855caf5d4eb
> ("hwmon: add driver for the hwmon parts of qnap-mcu devices"), which was a
> descendant of the series.
>
> Remove these always-"y" dependencies.
>
Dependencies such as "THERMAL || THERMAL=n" were supposed to enable the
driver to be built as module or into the kernel if THERMAL=n, and to
force it to be built as module if THERMAL=m. However, both THERMAL
and THERMAL_OF are boolean, so this really does not make sense.
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-30 2:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-29 21:54 [RFC PATCH] hwmon: remove tautological dependency expressions from Kconfig Laszlo Ersek
2026-07-29 21:59 ` sashiko-bot
2026-07-30 2:54 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox