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>
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) {