Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1679975 > unrolled thread

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

Started byKiran Gunda <kgunda@codeaurora.org>
First post2017-07-03 15:00 +0200
Last post2017-07-06 12:30 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH V1 4/4] spmi: pmic-arb: Remove checking opc value not less than 0 Kiran Gunda <kgunda@codeaurora.org> - 2017-07-03 15:00 +0200
    Re: [PATCH V1 4/4] spmi: pmic-arb: Remove checking opc value not  less than 0 Stephen Boyd <sboyd@codeaurora.org> - 2017-07-06 09:00 +0200
      Re: [PATCH V1 4/4] spmi: pmic-arb: Remove checking opc value not less  than 0 kgunda@codeaurora.org - 2017-07-06 12:30 +0200

#1679975 — [PATCH V1 4/4] spmi: pmic-arb: Remove checking opc value not less than 0

FromKiran Gunda <kgunda@codeaurora.org>
Date2017-07-03 15:00 +0200
Subject[PATCH V1 4/4] spmi: pmic-arb: Remove checking opc value not less than 0
Message-ID<tZ97j-1Az-9@gated-at.bofh.it>
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(-)

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;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [next] | [standalone]


#1682094 — Re: [PATCH V1 4/4] spmi: pmic-arb: Remove checking opc value not less than 0

FromStephen Boyd <sboyd@codeaurora.org>
Date2017-07-06 09:00 +0200
SubjectRe: [PATCH V1 4/4] spmi: pmic-arb: Remove checking opc value not less than 0
Message-ID<u08VA-Sf-19@gated-at.bofh.it>
In reply to#1679975
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.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [next] | [standalone]


#1682316 — Re: [PATCH V1 4/4] spmi: pmic-arb: Remove checking opc value not less than 0

Fromkgunda@codeaurora.org
Date2017-07-06 12:30 +0200
SubjectRe: [PATCH V1 4/4] spmi: pmic-arb: Remove checking opc value not less than 0
Message-ID<u0ccN-32q-13@gated-at.bofh.it>
In reply to#1682094
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.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web