* [PATCH] hwmon: (vexpress) use IS_ENABLED() for CONFIG_REGULATOR_VEXPRESS
@ 2026-12-04 2:22 Pengpeng Hou
2026-12-04 2:27 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-12-04 2:22 UTC (permalink / raw)
To: Guenter Roeck, Liviu Dudau, Sudeep Holla, Lorenzo Pieralisi
Cc: linux-hwmon, linux-arm-kernel, Pengpeng Hou, Liam Girdwood,
Mark Brown
Both the Versatile Express regulator and hwmon drivers match the voltage
node. The hwmon driver is intended to expose voltage only when the
regulator driver is not configured; its current guard still claims
voltage when the regulator is modular.
Use IS_ENABLED for the voltage attributes and match entry. The other
hwmon sensors remain available.
The issue was found by our static-analysis tool and manually reviewed.
Fixes: 48ed88772446 ("hwmon: Versatile Express hwmon driver")
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
---
The original patch was prepared with Gemini. Codex assisted with this
review and revision (Assisted-by: gpt 5).
Built vexpress-hwmon.o for arm64 with Clang 18 and W=1, with
SENSORS_VEXPRESS=m and REGULATOR_VEXPRESS=m. The arm,vexpress-volt
string was present before the change and absent afterwards;
arm,vexpress-temp remained present. No board was used.
drivers/hwmon/vexpress-hwmon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hwmon/vexpress-hwmon.c b/drivers/hwmon/vexpress-hwmon.c
index d38ac040eeee4ae529e034c86a17639e01c27a1f..a1da17c245712ca8aa6d148c98c31e850f6781c4 100644
--- a/drivers/hwmon/vexpress-hwmon.c
+++ b/drivers/hwmon/vexpress-hwmon.c
@@ -83,7 +83,7 @@ struct vexpress_hwmon_type {
const struct attribute_group **attr_groups;
};
-#if !defined(CONFIG_REGULATOR_VEXPRESS)
+#if !IS_ENABLED(CONFIG_REGULATOR_VEXPRESS)
static DEVICE_ATTR(in1_label, 0444, vexpress_hwmon_label_show, NULL);
static SENSOR_DEVICE_ATTR_RO(in1_input, vexpress_hwmon_u32, 1000);
static struct attribute *vexpress_hwmon_attrs_volt[] = {
@@ -181,7 +181,7 @@ static struct vexpress_hwmon_type vexpress_hwmon_energy = {
};
static const struct of_device_id vexpress_hwmon_of_match[] = {
-#if !defined(CONFIG_REGULATOR_VEXPRESS)
+#if !IS_ENABLED(CONFIG_REGULATOR_VEXPRESS)
{
.compatible = "arm,vexpress-volt",
.data = &vexpress_hwmon_volt,
base-commit: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hwmon: (vexpress) use IS_ENABLED() for CONFIG_REGULATOR_VEXPRESS
2026-12-04 2:22 [PATCH] hwmon: (vexpress) use IS_ENABLED() for CONFIG_REGULATOR_VEXPRESS Pengpeng Hou
@ 2026-12-04 2:27 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-12-04 2:27 UTC (permalink / raw)
To: Pengpeng Hou; +Cc: linux-hwmon
> Both the Versatile Express regulator and hwmon drivers match the voltage
> node. The hwmon driver is intended to expose voltage only when the
> regulator driver is not configured; its current guard still claims
> voltage when the regulator is modular.
>
> Use IS_ENABLED for the voltage attributes and match entry. The other
> hwmon sensors remain available.
>
> The issue was found by our static-analysis tool and manually reviewed.
>
> Fixes: 48ed88772446 ("hwmon: Versatile Express hwmon driver")
> Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/179635096045.74470.14679551183623100373@163.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-04 2:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 2:22 [PATCH] hwmon: (vexpress) use IS_ENABLED() for CONFIG_REGULATOR_VEXPRESS Pengpeng Hou
2026-12-04 2:27 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox