mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] pinctrl: rzn1: remove unnecessary unsigned integer comparison
Date: Fri, 12 Oct 2018 11:27:57 +0200	[thread overview]
Message-ID: <3c7f85b1-b80d-a963-f599-587dd49d1f12@embeddedor.com> (raw)
In-Reply-To: <CACRpkdb9b6kxgj736OmLhBvzhR26DT+bE2Y=jGaMB3411oa3yw@mail.gmail.com>



On 10/12/18 11:17 AM, Linus Walleij wrote:
> Sorry for top-posting, Geert is maintainer for this driver.
> 

Oh okay.

This is what I get when I run the get_maintainer scripts on the rzn1 driver:

$ scripts/get_maintainer.pl --nokeywords --nogit --nogit-fallback drivers/pinctrl/pinctrl-rzn1.c
Linus Walleij <linus.walleij@linaro.org> (maintainer:PIN CONTROL SUBSYSTEM)
linux-gpio@vger.kernel.org (open list:PIN CONTROL SUBSYSTEM)
linux-kernel@vger.kernel.org (open list)

Thanks
--
Gustavo

> Yours,
> Linus Walleij
> 
> On Thu, Oct 11, 2018 at 10:40 PM Gustavo A. R. Silva
> <gustavo@embeddedor.com> wrote:
>>
>> There is no need to compare ipctl->mdio_func[mdio] with => 0, because
>> such comparison is always true. Notice that *mdio_func* is of type
>> u32 (32 bits, unsigned).
>>
>> Fix this by removing such comparison.
>>
>> Addresses-Coverity-ID: 1474166 ("Unsigned compared against 0")
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>>  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 ce05e3a..b5650d8 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] != func)
>>                 dev_warn(ipctl->dev, "conflicting setting for mdio%d!\n", mdio);
>>         ipctl->mdio_func[mdio] = func;
>>
>> --
>> 2.7.4
>>

  reply	other threads:[~2018-10-12  9:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11 20:40 Gustavo A. R. Silva
2018-10-12  9:17 ` Linus Walleij
2018-10-12  9:27   ` Gustavo A. R. Silva [this message]
2018-10-15 14:21     ` Linus Walleij
2021-03-24  9:49 ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3c7f85b1-b80d-a963-f599-587dd49d1f12@embeddedor.com \
    --to=gustavo@embeddedor.com \
    --cc=geert+renesas@glider.be \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®