Skip to content

Commit

Permalink
platform/x86: asus-wmi: Fix "unsigned 'retval' is never less than zer…
Browse files Browse the repository at this point in the history
…o" 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@linux.alibaba.com>
Fixes: 98829e8 ("asus-wmi: Add dgpu disable method")
Fixes: 382b91d ("asus-wmi: Add egpu enable method")
Fixes: ca91ea3 ("asus-wmi: Add panel overdrive functionality")
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/1629887822-23918-1-git-send-email-jiapeng.chong@linux.alibaba.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
  • Loading branch information
Jiapeng Chong authored and Hans de Goede committed Aug 26, 2021
1 parent b72067c commit 828857f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/platform/x86/asus-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 828857f

Please sign in to comment.