From: Arnd Bergmann <arnd@arndb.de>
To: Marek Vasut <marek.vasut@gmail.com>, Jonathan Cameron <jic23@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
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-soc@vger.kernel.org,
Wolfram Sang <wsa@the-dreams.de>,
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@vger.kernel.org
Subject: [PATCH] iio: adc: gyroadc: fix uninitialized return code
Date: Thu, 4 Jul 2019 13:37:47 +0200 [thread overview]
Message-ID: <20190704113800.3299636-1-arnd@arndb.de> (raw)
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>
---
drivers/iio/adc/rcar-gyroadc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/adc/rcar-gyroadc.c b/drivers/iio/adc/rcar-gyroadc.c
index 2d685730f867..aec73cc43e23 100644
--- a/drivers/iio/adc/rcar-gyroadc.c
+++ b/drivers/iio/adc/rcar-gyroadc.c
@@ -391,7 +391,7 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
dev_err(dev,
"Channel %i uses different ADC mode than the rest.\n",
reg);
- return ret;
+ return -EINVAL;
}
/* Channel is valid, grab the regulator. */
--
2.20.0
next reply other threads:[~2019-07-04 11:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-04 11:37 Arnd Bergmann [this message]
2019-07-04 11:49 ` [PATCH] iio: adc: gyroadc: fix uninitialized return code Geert Uytterhoeven
2019-07-04 12:07 ` Wolfram Sang
2019-07-04 12:10 ` Geert Uytterhoeven
2019-07-04 15:27 ` Marek Vasut
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=20190704113800.3299636-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=geert+renesas@glider.be \
--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=marek.vasut@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