From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Walleij Subject: Re: [PATCH 1/6] pinctrl: imx: fix unsigned check if nfuncs with less than or equal zero Date: Wed, 2 May 2018 14:22:22 +0200 Message-ID: References: <1524855713-15527-1-git-send-email-aisheng.dong@nxp.com> <1524855713-15527-2-git-send-email-aisheng.dong@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1524855713-15527-2-git-send-email-aisheng.dong@nxp.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Dong Aisheng Cc: Dong Aisheng , Stefan Agner , "open list:GPIO SUBSYSTEM" , NXP Linux Team , Sascha Hauer , Fabio Estevam , Shawn Guo , Linux ARM List-Id: linux-gpio@vger.kernel.org On Fri, Apr 27, 2018 at 9:01 PM, Dong Aisheng wrote: > The unsigned integer nfuncs is being error checked with a value less > or equal to zero; this is always false if of_get_child_count returns a > -ve for an error condition since nfuncs is not signed. Fix this by > making variables nfuncs and i signed integers. > > Detected with Coccinelle: > drivers/pinctrl/freescale/pinctrl-imx.c:620:6-12: WARNING: Unsigned > expression compared with zero: nfuncs <= 0 > > Cc: Linus Walleij > Reported-by: Colin Ian King > Signed-off-by: Dong Aisheng Patch applied. Yours, Linus Walleij From mboxrd@z Thu Jan 1 00:00:00 1970 From: linus.walleij@linaro.org (Linus Walleij) Date: Wed, 2 May 2018 14:22:22 +0200 Subject: [PATCH 1/6] pinctrl: imx: fix unsigned check if nfuncs with less than or equal zero In-Reply-To: <1524855713-15527-2-git-send-email-aisheng.dong@nxp.com> References: <1524855713-15527-1-git-send-email-aisheng.dong@nxp.com> <1524855713-15527-2-git-send-email-aisheng.dong@nxp.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, Apr 27, 2018 at 9:01 PM, Dong Aisheng wrote: > The unsigned integer nfuncs is being error checked with a value less > or equal to zero; this is always false if of_get_child_count returns a > -ve for an error condition since nfuncs is not signed. Fix this by > making variables nfuncs and i signed integers. > > Detected with Coccinelle: > drivers/pinctrl/freescale/pinctrl-imx.c:620:6-12: WARNING: Unsigned > expression compared with zero: nfuncs <= 0 > > Cc: Linus Walleij > Reported-by: Colin Ian King > Signed-off-by: Dong Aisheng Patch applied. Yours, Linus Walleij