From patchwork Fri Nov 23 10:54:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Edworthy X-Patchwork-Id: 10695583 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4D0365A4 for ; Fri, 23 Nov 2018 10:54:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E9612C2D4 for ; Fri, 23 Nov 2018 10:54:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28C1E2C5C0; Fri, 23 Nov 2018 10:54:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SORTED_RECIPS autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCCF42C2D4 for ; Fri, 23 Nov 2018 10:54:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503572AbeKWVic (ORCPT ); Fri, 23 Nov 2018 16:38:32 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:52897 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2503150AbeKWVic (ORCPT ); Fri, 23 Nov 2018 16:38:32 -0500 Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 23 Nov 2018 19:54:43 +0900 Received: from vbox.ree.adwin.renesas.com (unknown [10.226.37.67]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 9A1634146021; Fri, 23 Nov 2018 19:54:41 +0900 (JST) From: Phil Edworthy To: Geert Uytterhoeven Cc: Jacopo Mondi , Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Phil Edworthy Subject: [PATCH] pinctrl: rzn1: Fix of_get_child_count() error check Date: Fri, 23 Nov 2018 10:54:28 +0000 Message-Id: <20181123105428.13457-2-phil.edworthy@renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181123105428.13457-1-phil.edworthy@renesas.com> References: <20181123105428.13457-1-phil.edworthy@renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If we assign the result of of_get_child_count() to an unsigned int, the code will not detect any errors. Therefore assign it to an int instead. Signed-off-by: Phil Edworthy Reviewed-by: Geert Uytterhoeven --- drivers/pinctrl/pinctrl-rzn1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-rzn1.c b/drivers/pinctrl/pinctrl-rzn1.c index a04235e3bec4..cc0e5aa9128a 100644 --- a/drivers/pinctrl/pinctrl-rzn1.c +++ b/drivers/pinctrl/pinctrl-rzn1.c @@ -810,8 +810,8 @@ static int rzn1_pinctrl_probe_dt(struct platform_device *pdev, struct device_node *np = pdev->dev.of_node; struct device_node *child; unsigned int maxgroups = 0; - unsigned int nfuncs = 0; unsigned int i = 0; + int nfuncs = 0; int ret; nfuncs = of_get_child_count(np);