From patchwork Mon Nov 19 16:18:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Edworthy X-Patchwork-Id: 10688893 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 AE9B117FE for ; Mon, 19 Nov 2018 16:18:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 99FC22974C for ; Mon, 19 Nov 2018 16:18:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 88D492975B; Mon, 19 Nov 2018 16:18:49 +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 EE6472974C for ; Mon, 19 Nov 2018 16:18:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729915AbeKTCmr (ORCPT ); Mon, 19 Nov 2018 21:42:47 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:36798 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729825AbeKTCmr (ORCPT ); Mon, 19 Nov 2018 21:42:47 -0500 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie5.idc.renesas.com with ESMTP; 20 Nov 2018 01:18:42 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 4A815403CE; Tue, 20 Nov 2018 01:18:42 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.56,253,1539615600"; d="scan'208";a="297864257" Received: from unknown (HELO vbox.ree.adwin.renesas.com) ([10.226.37.67]) by relmlii2.idc.renesas.com with ESMTP; 20 Nov 2018 01:18:40 +0900 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 check for used MDIO bus Date: Mon, 19 Nov 2018 16:18:38 +0000 Message-Id: <20181119161838.10610-1-phil.edworthy@renesas.com> X-Mailer: git-send-email 2.17.1 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 This fixes the check for unused mdio bus setting and the following static checker warning: drivers/pinctrl/pinctrl-rzn1.c:198 rzn1_pinctrl_mdio_select() warn: always true condition '(ipctl->mdio_func[mdio] >= 0) => (0-u32max >= 0)' It also fixes the return var when calling of_get_child_count() Reported-by: Dan Carpenter Signed-off-by: Phil Edworthy Reviewed-by: Geert Uytterhoeven --- v2: - Don't rely on rely on the implicit typecast from -1 to uint --- drivers/pinctrl/pinctrl-rzn1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-rzn1.c b/drivers/pinctrl/pinctrl-rzn1.c index 57886dcff53d..cc0e5aa9128a 100644 --- a/drivers/pinctrl/pinctrl-rzn1.c +++ b/drivers/pinctrl/pinctrl-rzn1.c @@ -112,7 +112,7 @@ struct rzn1_pinctrl { struct rzn1_pinctrl_regs __iomem *lev2; u32 lev1_protect_phys; u32 lev2_protect_phys; - u32 mdio_func[2]; + int mdio_func[2]; struct rzn1_pin_group *groups; unsigned int ngroups; @@ -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);