Return-Path: Received: from relmlor3.renesas.com ([210.160.252.173]:41631 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727497AbeJLSMc (ORCPT ); Fri, 12 Oct 2018 14:12:32 -0400 From: Phil Edworthy To: Geert Uytterhoeven Cc: Linus Walleij , linux-gpio@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Phil Edworthy Subject: [PATCH] pinctrl: rzn1: Fix check for used MDIO bus Date: Fri, 12 Oct 2018 11:40:36 +0100 Message-Id: <20181012104036.28829-1-phil.edworthy@renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org List-ID: 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)' Reported-by: Dan Carpenter Signed-off-by: Phil Edworthy --- 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 ce05e3a00be2..f688f3a29dfd 100644 --- a/drivers/pinctrl/pinctrl-rzn1.c +++ b/drivers/pinctrl/pinctrl-rzn1.c @@ -195,7 +195,7 @@ static void rzn1_hw_set_lock(struct rzn1_pinctrl *ipctl, u8 lock, u8 value) static void rzn1_pinctrl_mdio_select(struct rzn1_pinctrl *ipctl, int mdio, u32 func) { - if (ipctl->mdio_func[mdio] >= 0 && ipctl->mdio_func[mdio] != func) + if (ipctl->mdio_func[mdio] != -1 && ipctl->mdio_func[mdio] != func) dev_warn(ipctl->dev, "conflicting setting for mdio%d!\n", mdio); ipctl->mdio_func[mdio] = func; -- 2.17.1