[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1629887822-23918-1-git-send-email-jiapeng.chong@linux.alibaba.com>
Date: Wed, 25 Aug 2021 18:37:02 +0800
From: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
To: corentin.chary@...il.com
Cc: hdegoede@...hat.com, mgross@...ux.intel.com, jdelvare@...e.com,
linux@...ck-us.net, acpi4asus-user@...ts.sourceforge.net,
linux-kernel@...r.kernel.org, linux-hwmon@...r.kernel.org,
Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Subject: [PATCH] asus-wmi: Fix "unsigned 'retval' is never less than zero" smatch warning
Eliminate the follow smatch warnings:
drivers/platform/x86/asus-wmi.c:478 panel_od_write() warn: unsigned
'retval' is never less than zero.
drivers/platform/x86/asus-wmi.c:566 panel_od_write() warn: unsigned
'retval' is never less than zero.
drivers/platform/x86/asus-wmi.c:1451 panel_od_write() warn: unsigned
'retval' is never less than zero.
Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Fixes: 98829e84dc67 ("asus-wmi: Add dgpu disable method")
Fixes: 382b91db8044 ("asus-wmi: Add egpu enable method")
Fixes: ca91ea34778f ("asus-wmi: Add panel overdrive functionality")
Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
---
drivers/platform/x86/asus-wmi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index cc58118..22af431 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -475,7 +475,7 @@ static int dgpu_disable_write(struct asus_wmi *asus)
return err;
}
- if (retval > 1 || retval < 0) {
+ if (retval > 1) {
pr_warn("Failed to set dgpu disable (retval): 0x%x\n", retval);
return -EIO;
}
@@ -563,7 +563,7 @@ static int egpu_enable_write(struct asus_wmi *asus)
return err;
}
- if (retval > 1 || retval < 0) {
+ if (retval > 1) {
pr_warn("Failed to set egpu disable (retval): 0x%x\n", retval);
return -EIO;
}
@@ -1448,7 +1448,7 @@ static int panel_od_write(struct asus_wmi *asus)
return err;
}
- if (retval > 1 || retval < 0) {
+ if (retval > 1) {
pr_warn("Failed to set panel overdrive (retval): 0x%x\n", retval);
return -EIO;
}
--
1.8.3.1
Powered by blists - more mailing lists