Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752462AbcKGJFq (ORCPT ); Mon, 7 Nov 2016 04:05:46 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:53182 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751218AbcKGJFn (ORCPT ); Mon, 7 Nov 2016 04:05:43 -0500 Subject: Re: [PATCH 1/1] pinctrl: st: st_pctl_dt_parse_groups simplify expression To: Heinrich Schuchardt , Linus Walleij References: <20161105143515.4668-1-xypron.glpk@gmx.de> CC: , , , From: Patrice Chotard Message-ID: <1ac9af0e-0a00-757b-6981-0ff9461fbbb3@st.com> Date: Mon, 7 Nov 2016 10:05:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161105143515.4668-1-xypron.glpk@gmx.de> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.48.1.66] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-07_03:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 937 Lines: 31 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 > --- > 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 Thanks