From: Jonathan Cameron <jic23@kernel.org>
To: Peter Meerwald <pmeerw@pmeerw.net>, linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio:magnetometer:mag3110: Fix unreachable code
Date: Tue, 25 Feb 2014 20:50:16 +0000 [thread overview]
Message-ID: <530D0208.7030307@kernel.org> (raw)
In-Reply-To: <1393357985-9314-1-git-send-email-pmeerw@pmeerw.net>
On 25/02/14 19:53, Peter Meerwald wrote:
> drivers/iio/magnetometer/mag3110.c:197 mag3110_read_raw()
> info: ignoring unreachable code.
>
> drivers/iio/magnetometer/mag3110.c
> 185 case IIO_CHAN_INFO_SCALE:
> 186 switch (chan->type) {
> 187 case IIO_MAGN:
> 188 *val = 0;
> 189 *val2 = 1000;
> 190 return IIO_VAL_INT_PLUS_MICRO;
> 191 case IIO_TEMP:
> 192 *val = 1000;
> 193 return IIO_VAL_INT;
> 194 default:
> 195 return -EINVAL;
> 196 }
> 197 return IIO_VAL_INT_PLUS_MICRO;
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> introduced by f9279d3a, mag3110: Scale factor missing
>
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied to the togreg branch of iio.git
Thanks,
> ---
> drivers/iio/magnetometer/mag3110.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/iio/magnetometer/mag3110.c b/drivers/iio/magnetometer/mag3110.c
> index 9f260a5..e3106b4 100644
> --- a/drivers/iio/magnetometer/mag3110.c
> +++ b/drivers/iio/magnetometer/mag3110.c
> @@ -194,7 +194,6 @@ static int mag3110_read_raw(struct iio_dev *indio_dev,
> default:
> return -EINVAL;
> }
> - return IIO_VAL_INT_PLUS_MICRO;
> case IIO_CHAN_INFO_SAMP_FREQ:
> i = data->ctrl_reg1 >> MAG3110_CTRL_DR_SHIFT;
> *val = mag3110_samp_freq[i][0];
>
next prev parent reply other threads:[~2014-02-25 20:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-24 22:04 iio:magnetometer:mag3110: Scale factor missing for temperature Dan Carpenter
2014-02-25 19:53 ` [PATCH] iio:magnetometer:mag3110: Fix unreachable code Peter Meerwald
2014-02-25 20:50 ` Jonathan Cameron [this message]
2014-02-25 20:00 ` iio:magnetometer:mag3110: Scale factor missing for temperature Peter Meerwald
2014-02-25 20:49 ` 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=530D0208.7030307@kernel.org \
--to=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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.