diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-03-30 13:26:50 +0300 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-03-30 13:26:50 +0300 |
commit | d878bdfba8ffda64265c921cf7497934a607f83a (patch) | |
tree | befd94c3b5474376ad279dc8f1c37f7c4a4228e5 /drivers/platform | |
parent | ba308bd09099d3997f7d95e928a3664f8b20e619 (diff) | |
download | linux-d878bdfba8ffda64265c921cf7497934a607f83a.tar.bz2 |
platform/x86: surface3_power: Fix always true condition in mshw0011_space_handler()
smatch warnings:
.../surface3_power.c:417 mshw0011_space_handler() warn: always true condition '(ret >= 0) => +(0-u32max >= 0)'
Refactor error handling returned by mshw0011_adp_psr() to avoid always
true condition.
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/surface3_power.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/platform/x86/surface3_power.c b/drivers/platform/x86/surface3_power.c index cf08911251f3..946ac2dc08ae 100644 --- a/drivers/platform/x86/surface3_power.c +++ b/drivers/platform/x86/surface3_power.c @@ -402,12 +402,14 @@ mshw0011_space_handler(u32 function, acpi_physical_address command, if (gsb->cmd.arg0 == MSHW0011_CMD_DEST_ADP1 && gsb->cmd.arg1 == MSHW0011_CMD_ADP1_PSR) { - ret = mshw0011_adp_psr(cdata); - if (ret >= 0) { - status = ret; - ret = 0; + status = mshw0011_adp_psr(cdata); + if (status >= 0) { + ret = AE_OK; + goto out; + } else { + ret = AE_ERROR; + goto err; } - goto out; } if (gsb->cmd.arg0 != MSHW0011_CMD_DEST_BAT0) { |