Skip to contentSkip to conversation

platform/x86: asus-wmi: suppress -ENODEV warning in fan_curve_get_factory_default()

PATCH In review Armandas Kvietkus 2 participants 2 messages May 3 – May 6

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

PATCH 1/1 platform/x86: asus-wmi: suppress -ENODEV warning in fan_curve_get_factory_default()

When the firmware does not support the fan curve WMI method, asus_wmi_evaluate_method_buf() returns -ENODEV. The caller fan_curve_check_present() already handles this gracefully by treating it as a non-error, but fan_curve_get_factory_default() still emits a pr_warn() before returning, producing spurious boot noise on unsupported hardware.

Suppress the warning for -ENODEV only, consistent with how this error is handled elsewhere in asus-wmi.c.

---
 drivers/platform/x86/asus-wmi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/x86/asus-wmi.c +2 -1
index 80144c412..9b12a9e1e 100644
@@ -3538,7 +3538,8 @@ static int fan_curve_get_factory_default(struct asus_wmi *asus, u32 fan_dev)
 	err = asus_wmi_evaluate_method_buf(asus->dsts_id, fan_dev, mode, buf,
 					   FAN_CURVE_BUF_LEN);
 	if (err) {
-		pr_warn("%s (0x%08x) failed: %d\n", __func__, fan_dev, err);
+		if (err != -ENODEV)
+			pr_warn("%s (0x%08x) failed: %d\n", __func__, fan_dev, err);
 		return err;
 	}
 
Signature · 1 line
2.54.0
maintainer
#1 lore raw
Quoted 22 lines · Armandas Kvietkus

When the firmware does not support the fan curve WMI method, asus_wmi_evaluate_method_buf() returns -ENODEV. The caller fan_curve_check_present() already handles this gracefully by treating it as a non-error, but fan_curve_get_factory_default() still emits a pr_warn() before returning, producing spurious boot noise on unsupported hardware.

Suppress the warning for -ENODEV only, consistent with how this error is handled elsewhere in asus-wmi.c.

---
 drivers/platform/x86/asus-wmi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/x86/asus-wmi.c +0 -0
index 80144c412..9b12a9e1e 100644

drivers/platform/x86/asus-wmi.c static int fan_curve_get_factory_default(struct asus_wmi *asus, u32 fan_dev) · line 3542

Quoted 6 lines
drivers/platform/x86/asus-wmi.c +2 -1
@@ -3538,7 +3538,8 @@ static int fan_curve_get_factory_default(struct asus_wmi *asus, u32 fan_dev)
 	err = asus_wmi_evaluate_method_buf(asus->dsts_id, fan_dev, mode, buf,
 					   FAN_CURVE_BUF_LEN);
 	if (err) {
-		pr_warn("%s (0x%08x) failed: %d\n", __func__, fan_dev, err);
+		if (err != -ENODEV)
+			pr_warn("%s (0x%08x) failed: %d\n", __func__, fan_dev, err);

Hi,

If this print is useful at all, it looks more like it wants to be on debug level which would also prevent the warning appearing in the logs unless asked to.

Whenever something prints just __func__ and error codes, the line is hardly meant for normal user consumption.

If you want to preserve this on warn level, the message has to be changed as well to say the warning in plain English (preferrable in another another patch).

(I prefer making it debug level.)

Signature · 1 line
 i.