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


Groups > linux.kernel > #1515560 > unrolled thread

[PATCH 1/1] pinctrl: st: st_pctl_dt_parse_groups simplify expression

Started byHeinrich Schuchardt <xypron.glpk@gmx.de>
First post2016-11-05 15:40 +0100
Last post2016-11-08 11:30 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] pinctrl: st: st_pctl_dt_parse_groups simplify expression Heinrich Schuchardt <xypron.glpk@gmx.de> - 2016-11-05 15:40 +0100
    Re: [PATCH 1/1] pinctrl: st: st_pctl_dt_parse_groups simplify  expression Patrice Chotard <patrice.chotard@st.com> - 2016-11-07 10:10 +0100
    Re: [PATCH 1/1] pinctrl: st: st_pctl_dt_parse_groups simplify expression Linus Walleij <linus.walleij@linaro.org> - 2016-11-08 11:30 +0100

#1515560 — [PATCH 1/1] pinctrl: st: st_pctl_dt_parse_groups simplify expression

FromHeinrich Schuchardt <xypron.glpk@gmx.de>
Date2016-11-05 15:40 +0100
Subject[PATCH 1/1] pinctrl: st: st_pctl_dt_parse_groups simplify expression
Message-ID<sAait-Cr-7@gated-at.bofh.it>
for_each_property_of_node(pins, pp) checks that pp is not NULL.
So there is no need to check it inside the loop.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/pinctrl/pinctrl-st.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
index 8308f15..676efcc 100644
--- a/drivers/pinctrl/pinctrl-st.c
+++ b/drivers/pinctrl/pinctrl-st.c
@@ -1181,7 +1181,7 @@ static int st_pctl_dt_parse_groups(struct device_node *np,
 		if (!strcmp(pp->name, "name"))
 			continue;
 
-		if (pp  && (pp->length/sizeof(__be32)) >= OF_GPIO_ARGS_MIN) {
+		if (pp->length / sizeof(__be32) >= OF_GPIO_ARGS_MIN) {
 			npins++;
 		} else {
 			pr_warn("Invalid st,pins in %s node\n", np->name);
-- 
2.10.1

[toc] | [next] | [standalone]


#1515922 — Re: [PATCH 1/1] pinctrl: st: st_pctl_dt_parse_groups simplify expression

FromPatrice Chotard <patrice.chotard@st.com>
Date2016-11-07 10:10 +0100
SubjectRe: [PATCH 1/1] pinctrl: st: st_pctl_dt_parse_groups simplify expression
Message-ID<sAO6e-UV-51@gated-at.bofh.it>
In reply to#1515560

On 11/05/2016 03:35 PM, Heinrich Schuchardt wrote:
> for_each_property_of_node(pins, pp) checks that pp is not NULL.
> So there is no need to check it inside the loop.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  drivers/pinctrl/pinctrl-st.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
> index 8308f15..676efcc 100644
> --- a/drivers/pinctrl/pinctrl-st.c
> +++ b/drivers/pinctrl/pinctrl-st.c
> @@ -1181,7 +1181,7 @@ static int st_pctl_dt_parse_groups(struct device_node *np,
>  		if (!strcmp(pp->name, "name"))
>  			continue;
>  
> -		if (pp  && (pp->length/sizeof(__be32)) >= OF_GPIO_ARGS_MIN) {
> +		if (pp->length / sizeof(__be32) >= OF_GPIO_ARGS_MIN) {
>  			npins++;
>  		} else {
>  			pr_warn("Invalid st,pins in %s node\n", np->name);
> 

Hi Heinrich

Acked-by: Patrice Chotard <patrice.chotard@st.com>

Thanks

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


#1517044

FromLinus Walleij <linus.walleij@linaro.org>
Date2016-11-08 11:30 +0100
Message-ID<sBbPb-88c-3@gated-at.bofh.it>
In reply to#1515560
On Sat, Nov 5, 2016 at 3:35 PM, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:

> for_each_property_of_node(pins, pp) checks that pp is not NULL.
> So there is no need to check it inside the loop.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Patch applied with Patrice's ACK.

Yours,
Linus Walleij

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web