Skip to content

Commit

Permalink
spmi: pmic-arb: u8 <= 0xff is always true
Browse files Browse the repository at this point in the history
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 <agross@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Stephen Boyd authored and Greg Kroah-Hartman committed Oct 4, 2015
1 parent d514479 commit 9b76968
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spmi/spmi-pmic-arb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9b76968

Please sign in to comment.