Commit d878bdfb authored by Andy Shevchenko's avatar Andy Shevchenko

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: default avatarkbuild test robot <lkp@intel.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent ba308bd0
...@@ -402,12 +402,14 @@ mshw0011_space_handler(u32 function, acpi_physical_address command, ...@@ -402,12 +402,14 @@ mshw0011_space_handler(u32 function, acpi_physical_address command,
if (gsb->cmd.arg0 == MSHW0011_CMD_DEST_ADP1 && if (gsb->cmd.arg0 == MSHW0011_CMD_DEST_ADP1 &&
gsb->cmd.arg1 == MSHW0011_CMD_ADP1_PSR) { gsb->cmd.arg1 == MSHW0011_CMD_ADP1_PSR) {
ret = mshw0011_adp_psr(cdata); status = mshw0011_adp_psr(cdata);
if (ret >= 0) { if (status >= 0) {
status = ret; ret = AE_OK;
ret = 0;
}
goto out; goto out;
} else {
ret = AE_ERROR;
goto err;
}
} }
if (gsb->cmd.arg0 != MSHW0011_CMD_DEST_BAT0) { if (gsb->cmd.arg0 != MSHW0011_CMD_DEST_BAT0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment