spmi: pmic-arb: u8 <= 0xff is always true
Subsystems (2)
PATCH 1/1 spmi: pmic-arb: u8 <= 0xff is always true
Silences this static checker warning:
drivers/spmi/spmi-pmic-arb.c:363
pmic_arb_write_cmd() warn: always true condition
'(opc <= 255) => (0-255 <= 255)'
Cc Andy Gross <[email protected]>
Cc Bjorn Andersson <[email protected]>
Signed-off-by Stephen Boyd <[email protected]>
--- drivers/spmi/spmi-pmic-arb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spmi/spmi-pmic-arb.c +1 -1
@@ -360,7 +360,7 @@ static int pmic_arb_write_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid, opc =PMIC_ARB_OP_EXT_WRITE ; else if (opc >= 0x30 && opc <= 0x37) opc =PMIC_ARB_OP_EXT_WRITEL ; - else if (opc >= 0x80 && opc <= 0xFF) + else if (opc >= 0x80) opc =PMIC_ARB_OP_ZERO_WRITE ; else return -EINVAL;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Quoted 7 lines · Stephen Boyd
Silences this static checker warning:
drivers/spmi/spmi-pmic-arb.c:363
pmic_arb_write_cmd()warn: always true condition
'(opc <= 255) => (0-255 <= 255)'Cc Andy Gross <[email protected]>
Reviewed-by Bjorn Andersson <[email protected]>
Regards,
Bjorn