Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2577858imu; Fri, 23 Nov 2018 11:18:13 -0800 (PST) X-Google-Smtp-Source: AJdET5fjUoJZ7RTrmX9zyEr7eM/ncU109ahw1BjFa/8TW11WABPLZDx8+fPRUtGk//F3l291MI/T X-Received: by 2002:a62:9683:: with SMTP id s3mr17181701pfk.60.1543000692982; Fri, 23 Nov 2018 11:18:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543000692; cv=none; d=google.com; s=arc-20160816; b=Ao/8msZj3qDyZk+pygjYUPQwXmc6cuFhtqsVKxfL+Upo+ZRWm3WNgJ8gQ3lal5BvS0 v/mhluPYXTErghsdBhx9Yp5b1juNG11DsYrBIcMKcljdTAw+hHvWFZr5xhb5TsbS8lqj CvupyYy4DeESptApzOLxkZu+M6RfR5m9FGw7mpfR//ftAT8IvkNGcj25oJLFrU0qBqso Ozob1+IN4hM09ByUc8jzCoshKmzBmhQHRQk4I0rdIVpPz7fiHbI02KPI0cRe9pJuoBCp 3c1NghozO4KWBACQISpyMYoPfvWB0Cp6DQ1QQI3sxUyf3e3DhaJnFW7NUc4ImXcGLhac lOHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organisation:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=vHj4y2YWxIPSmLjsB0vVJHkjiFfdczlzabqQ61K0rR4=; b=1Bhdp5Lbk77WQyeRmsHEMQ19hylqwKAnGJeFo8ZmyBd8HDphiGs0ClXiaiM5kvbBRH Nuqz3bDSot3Oaz8RJecyf8zqtGWDNDuv8w4Jn4tJvwco5SEX1xS5Gcob/UktP10vcUr1 MUJ4rR4fxVRRDgDBBhfA5hHrEaV0La0rHgpO0TiX3dAAVGV/FO96PAOU3YxFsKPjjnV0 mHrnW8xZeP40OX9If1jSduklWbkI5FPaEtbj8O2xSUU8jdL5UccNgMfgoFcgzLSIfO1q ZuQWXRg4313NtzjW/wx9X3R2xOtVl5lAVqlKiYCNeocjgvwcd/gB2NjsqXQpOO5ctA/V pVwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@verge.net.au header.s=mail header.b=pyxZ3Oeo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4si5681666plc.320.2018.11.23.11.17.57; Fri, 23 Nov 2018 11:18:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@verge.net.au header.s=mail header.b=pyxZ3Oeo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732380AbeKWAsI (ORCPT + 99 others); Thu, 22 Nov 2018 19:48:08 -0500 Received: from kirsty.vergenet.net ([202.4.237.240]:37900 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730414AbeKWAsI (ORCPT ); Thu, 22 Nov 2018 19:48:08 -0500 Received: from reginn.horms.nl (watermunt.horms.nl [80.127.179.77]) by kirsty.vergenet.net (Postfix) with ESMTPA id 1735025BDFD; Fri, 23 Nov 2018 01:08:35 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1542895715; bh=saPfczYdxwFdiYA7nifJ+WLbmpTcdXhH54nNaj87G/E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pyxZ3Oeo7sqyDDWnsrW5ORuZNP7DiJmJBrepgeIUj62h/7/AzgYbXRZMiKSl9NiTT y9lH+jR6OV1KRr+fKB1ZbqcBK2ipFqRMo7xA+cIyojuw0Z6ncwlp0ie6ngM52a2tEc M24ET2bSFRp9n3WCYcfALst+XqNZSIfJI0MCIHcY= Received: by reginn.horms.nl (Postfix, from userid 7100) id 26099940370; Thu, 22 Nov 2018 15:08:33 +0100 (CET) Date: Thu, 22 Nov 2018 15:08:33 +0100 From: Simon Horman To: Phil Edworthy Cc: Geert Uytterhoeven , Jacopo Mondi , Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: Re: [PATCH] pinctrl: rzn1: Fix check for used MDIO bus Message-ID: <20181122140832.qcrhmmybdzbvfv6s@verge.net.au> References: <20181119161838.10610-1-phil.edworthy@renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181119161838.10610-1-phil.edworthy@renesas.com> Organisation: Horms Solutions BV User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 19, 2018 at 04:18:38PM +0000, Phil Edworthy wrote: > 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 > --- > 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]; Hi Phil, rzn1_pinctrl_mdio_select() assigns values of type u32 to elements of mdio_func. Perhaps that warrants cleaning up too? > > 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); > -- > 2.17.1 >