From: Marek Vasut <marek.vasut@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
Wolfram Sang <wsa@the-dreams.de>
Cc: Arnd Bergmann <arnd@arndb.de>,
Jonathan Cameron <jic23@kernel.org>,
stable <stable@vger.kernel.org>,
Marek Vasut <marek.vasut+renesas@gmail.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Simon Horman <horms+renesas@verge.net.au>,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Rob Herring <robh@kernel.org>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
linux-iio@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] iio: adc: gyroadc: fix uninitialized return code
Date: Thu, 4 Jul 2019 17:27:15 +0200 [thread overview]
Message-ID: <fc3b8b4e-fe0e-9573-124d-4b41efa409e4@gmail.com> (raw)
In-Reply-To: <CAMuHMdXDN60WWFerok1h05COdNNPZTMDCgKXejmQZMj9B6y5Cw@mail.gmail.com>
On 7/4/19 2:10 PM, Geert Uytterhoeven wrote:
> Hi Wolfram,
>
> On Thu, Jul 4, 2019 at 2:08 PM Wolfram Sang <wsa@the-dreams.de> wrote:
>> On Thu, Jul 04, 2019 at 01:37:47PM +0200, Arnd Bergmann wrote:
>>> gcc-9 complains about a blatant uninitialized variable use that
>>> all earlier compiler versions missed:
>>>
>>> drivers/iio/adc/rcar-gyroadc.c:510:5: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
>>>
>>> Return -EINVAL instead here.
>>>
>>> Cc: stable@vger.kernel.org
>>> Fixes: 059c53b32329 ("iio: adc: Add Renesas GyroADC driver")
>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>
>> This is correct but missing that the above 'return ret' is broken, too.
>> ret is initialized but 0 in that case.
>
> Nice catch! Oh well, given enough eyeballs, ...
I don't think ret is initialized, reg is, not ret .
>> And maybe we can use something else than -EINVAL for this case? I am on
>> the go right now, I will look for a suggestion later.
>
> -EINVAL is correct here (and in the above case, too), IMHO.
Yep, -EINVAL is fine.
--
Best regards,
Marek Vasut
next prev parent reply other threads:[~2019-07-04 15:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-04 11:37 [PATCH] iio: adc: gyroadc: fix uninitialized return code Arnd Bergmann
2019-07-04 11:49 ` Geert Uytterhoeven
2019-07-04 12:07 ` Wolfram Sang
2019-07-04 12:10 ` Geert Uytterhoeven
2019-07-04 15:27 ` Marek Vasut [this message]
2019-07-04 19:55 ` Wolfram Sang
2019-07-14 15:09 ` Jonathan Cameron
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=fc3b8b4e-fe0e-9573-124d-4b41efa409e4@gmail.com \
--to=marek.vasut@gmail.com \
--cc=arnd@arndb.de \
--cc=geert+renesas@glider.be \
--cc=geert@linux-m68k.org \
--cc=horms+renesas@verge.net.au \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=marek.vasut+renesas@gmail.com \
--cc=pmeerw@pmeerw.net \
--cc=robh@kernel.org \
--cc=stable@vger.kernel.org \
--cc=wsa@the-dreams.de \
/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;
as well as URLs for NNTP newsgroup(s).