[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180920180529.hjc54yoqmvnpvvt7@mwanda>
Date: Thu, 20 Sep 2018 21:05:29 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Janusz Krzysztofik <jmkrzyszt@...il.com>
Cc: Marek Szyprowski <m.szyprowski@...sung.com>,
Andrew Lunn <andrew@...n.ch>,
Ulf Hansson <ulf.hansson@...aro.org>,
linux-doc@...r.kernel.org, linux-iio@...r.kernel.org,
Linus Walleij <linus.walleij@...aro.org>,
Dominik Brodowski <linux@...inikbrodowski.net>,
Peter Rosin <peda@...ntia.se>, netdev@...r.kernel.org,
linux-i2c@...r.kernel.org,
Peter Meerwald-Stadler <pmeerw@...erw.net>,
devel@...verdev.osuosl.org,
Florian Fainelli <f.fainelli@...il.com>,
Jonathan Corbet <corbet@....net>,
Krzysztof Kozlowski <krzk@...nel.org>,
Kishon Vijay Abraham I <kishon@...com>,
Tony Lindgren <tony@...mide.com>,
Lukas Wunner <lukas@...ner.de>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
linux-serial@...r.kernel.org, Jiri Slaby <jslaby@...e.com>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>, linux-gpio@...r.kernel.org,
Russell King <rmk+kernel@...linux.org.uk>,
Lars-Peter Clausen <lars@...afoo.de>,
Yegor Yefremov <yegorslists@...glemail.com>,
Sebastien Bourdelin <sebastien.bourdelin@...oirfairelinux.com>,
"'Linux Samsung SOC'" <linux-samsung-soc@...r.kernel.org>,
Rojhalat Ibrahim <imr@...chenk.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org,
Willy Tarreau <w@....eu>,
Miguel Ojeda Sandonis <miguel.ojeda.sandonis@...il.com>,
Peter Korsgaard <peter.korsgaard@...co.com>,
Hartmut Knaack <knaack.h@....de>,
"David S. Miller" <davem@...emloft.net>,
Jonathan Cameron <jic23@...nel.org>
Subject: Re: [PATCH v7 4/4] gpiolib: Implement fast processing path in
get/set array
On Thu, Sep 20, 2018 at 05:48:22PM +0200, Janusz Krzysztofik wrote:
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index a53d17745d21..5bc3447949c9 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -2880,7 +2880,7 @@ int gpiod_get_array_value_complex(bool raw, bool can_sleep,
> __set_bit(hwgpio, mask);
>
> if (array_info)
> - find_next_zero_bit(array_info->get_mask,
> + i = find_next_zero_bit(array_info->get_mask,
> array_size, i);
We could mark find_next_zero_bit() and friends as a __must_check
functions so we avoid this bug in the future. I have a more complicated
idea how to detect these bugs in a generic way using Smatch but it will
take longer to implement.
regards,
dan carpenter
Powered by blists - more mailing lists