Commit 02d8ecc1 authored by Sibi Sankar's avatar Sibi Sankar Committed by Bjorn Andersson

soc: qcom: pdr: Remove impossible error condition

The patch fbe639b4: "soc: qcom: Introduce Protection Domain
Restart helpers" leads to the following static checker warning:

drivers/soc/qcom/pdr_interface.c:158 pdr_register_listener()
'(resp.curr_state < (-((~0 >> 1)) - 1)) => (s32min-s32max < s32min)'
These are casted to int so they can't be outside of int range.

Fixes: fbe639b4 ("soc: qcom: Introduce Protection Domain Restart helpers")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarSibi Sankar <sibis@codeaurora.org>
Link: https://lore.kernel.org/r/20200415062955.21439-1-sibis@codeaurora.orgSigned-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent 35bb4b22
...@@ -155,10 +155,6 @@ static int pdr_register_listener(struct pdr_handle *pdr, ...@@ -155,10 +155,6 @@ static int pdr_register_listener(struct pdr_handle *pdr,
return ret; return ret;
} }
if ((int)resp.curr_state < INT_MIN || (int)resp.curr_state > INT_MAX)
pr_err("PDR: %s notification state invalid: 0x%x\n",
pds->service_path, resp.curr_state);
pds->state = resp.curr_state; pds->state = resp.curr_state;
return 0; return 0;
......
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