diff mbox

[V1,4/4] spmi: pmic-arb: Remove checking opc value not less than 0

Message ID 1499086338-19498-5-git-send-email-kgunda@codeaurora.org (mailing list archive)
State Not Applicable, archived
Delegated to: Andy Gross
Headers show

Commit Message

Kiran Gunda July 3, 2017, 12:52 p.m. UTC
From: Fenglin Wu <fenglinw@codeaurora.org>

The opc parameter in pmic_arb_write_cmd() function is defined with type
u8 and it's always greater than or equal to 0. Checking that it's not
less than 0 is redundant and it can cause a forbidden warning during
compilation. Remove the check.

Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
---
 drivers/spmi/spmi-pmic-arb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stephen Boyd July 6, 2017, 6:53 a.m. UTC | #1
On 07/03, Kiran Gunda wrote:
> From: Fenglin Wu <fenglinw@codeaurora.org>
> 
> The opc parameter in pmic_arb_write_cmd() function is defined with type
> u8 and it's always greater than or equal to 0. Checking that it's not
> less than 0 is redundant and it can cause a forbidden warning during
> compilation. Remove the check.
> 
> Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
> ---

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Stephen Boyd July 6, 2017, 6:53 a.m. UTC | #2
On 07/03, Kiran Gunda wrote:
> From: Fenglin Wu <fenglinw@codeaurora.org>
> 
> The opc parameter in pmic_arb_write_cmd() function is defined with type
> u8 and it's always greater than or equal to 0. Checking that it's not
> less than 0 is redundant and it can cause a forbidden warning during
> compilation. Remove the check.
> 
> Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
> ---

You forgot your sign-off here.
Kiran Gunda July 6, 2017, 10:21 a.m. UTC | #3
On 2017-07-06 12:23, Stephen Boyd wrote:
> On 07/03, Kiran Gunda wrote:
>> From: Fenglin Wu <fenglinw@codeaurora.org>
>> 
>> The opc parameter in pmic_arb_write_cmd() function is defined with 
>> type
>> u8 and it's always greater than or equal to 0. Checking that it's not
>> less than 0 is redundant and it can cause a forbidden warning during
>> compilation. Remove the check.
>> 
>> Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
>> ---
> 
> You forgot your sign-off here.
yeah.. forgot. Will add it.
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
index bc88c19..b49e77a 100644
--- a/drivers/spmi/spmi-pmic-arb.c
+++ b/drivers/spmi/spmi-pmic-arb.c
@@ -417,7 +417,7 @@  static int pmic_arb_write_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid,
 	/* Check the opcode */
 	if (opc >= 0x40 && opc <= 0x5F)
 		opc = PMIC_ARB_OP_WRITE;
-	else if (opc >= 0x00 && opc <= 0x0F)
+	else if (opc <= 0x0F)
 		opc = PMIC_ARB_OP_EXT_WRITE;
 	else if (opc >= 0x30 && opc <= 0x37)
 		opc = PMIC_ARB_OP_EXT_WRITEL;