Skip to contentSkip to conversation

hwmon: (vexpress) use IS_ENABLED() for CONFIG_REGULATOR_VEXPRESS

PATCH Applied Pengpeng Hou 3 participants 3 messages Dec 4

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (vexpress) use IS_ENABLED() for CONFIG_REGULATOR_VEXPRESS

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")

---
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(-)
drivers/hwmon/vexpress-hwmon.c +2 -2
index d38ac040eeee4ae529e034c86a17639e01c27a1f..a1da17c245712ca8aa6d148c98c31e850f6781c4 100644
@@ -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

#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 5 lines

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.

Quoted 7 lines

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")

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer Applied
#2 lore raw
In reply to Pengpeng Hou
Quoted 5 lines · Pengpeng Hou

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.

Quoted 7 lines

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")

Applied.

Thanks,
Guenter