From: Jonathan Cameron <jic23@kernel.org>
To: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: <linux-iio@vger.kernel.org>
Subject: Re: [PATCH] iio: imu: adis16400: fix compiler warnings
Date: Sat, 12 Oct 2019 12:48:30 +0100 [thread overview]
Message-ID: <20191012124830.49a0e3c7@archlinux> (raw)
In-Reply-To: <20191008085156.6255-1-alexandru.ardelean@analog.com>
On Tue, 8 Oct 2019 11:51:56 +0300
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:
> GCC 8 complains about plenty of 'maybe-uninitialized' warnings.
> This patch fixes all of them.
>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Applied in a bit of a hurry as Greg ran into these as well.
Pull request already gone out.
Thanks,
Jonathan
> ---
> drivers/iio/imu/adis16400.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/imu/adis16400.c b/drivers/iio/imu/adis16400.c
> index e042a2aabf6b..d0b7dce798f4 100644
> --- a/drivers/iio/imu/adis16400.c
> +++ b/drivers/iio/imu/adis16400.c
> @@ -325,7 +325,7 @@ static struct adis_burst adis16400_burst = {
> static int adis16334_get_freq(struct adis16400_state *st)
> {
> int ret;
> - uint16_t t;
> + uint16_t t = 0;
>
> ret = __adis_read_reg_16(&st->adis, ADIS16400_SMPL_PRD, &t);
> if (ret < 0)
> @@ -338,7 +338,7 @@ static int adis16334_get_freq(struct adis16400_state *st)
>
> static int adis16334_set_freq(struct adis16400_state *st, unsigned int freq)
> {
> - unsigned int t;
> + unsigned int t = 0;
>
> if (freq < 819200)
> t = ilog2(819200 / freq);
> @@ -357,7 +357,7 @@ static int adis16334_set_freq(struct adis16400_state *st, unsigned int freq)
> static int adis16400_get_freq(struct adis16400_state *st)
> {
> int sps, ret;
> - uint16_t t;
> + uint16_t t = 0;
>
> ret = __adis_read_reg_16(&st->adis, ADIS16400_SMPL_PRD, &t);
> if (ret < 0)
> @@ -408,7 +408,7 @@ static const unsigned int adis16400_3db_divisors[] = {
> static int __adis16400_set_filter(struct iio_dev *indio_dev, int sps, int val)
> {
> struct adis16400_state *st = iio_priv(indio_dev);
> - uint16_t val16;
> + uint16_t val16 = 0;
> int i, ret;
>
> for (i = ARRAY_SIZE(adis16400_3db_divisors) - 1; i >= 1; i--) {
> @@ -554,7 +554,7 @@ static int adis16400_read_raw(struct iio_dev *indio_dev,
> {
> struct adis16400_state *st = iio_priv(indio_dev);
> struct mutex *slock = &st->adis.state_lock;
> - int16_t val16;
> + int16_t val16 = 0;
> int ret;
>
> switch (info) {
next prev parent reply other threads:[~2019-10-12 11:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-08 8:51 [PATCH] iio: imu: adis16400: fix compiler warnings Alexandru Ardelean
2019-10-12 11:48 ` Jonathan Cameron [this message]
2019-10-12 12:06 ` 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=20191012124830.49a0e3c7@archlinux \
--to=jic23@kernel.org \
--cc=alexandru.ardelean@analog.com \
--cc=linux-iio@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.