* [PATCH] iio temperature/mlx90632: silence a static checker warning
@ 2018-02-22 9:14 Dan Carpenter
2018-02-22 9:26 ` Crt Mori
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2018-02-22 9:14 UTC (permalink / raw)
To: Crt Mori
Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, linux-iio, kernel-janitors
This shouldn't affect runtime at all, but Smatch complains that we
should check if mlx90632_read_ambient_raw() otherwise we
"ambient_new_raw" can be uninitialized.
drivers/iio/temperature/mlx90632.c:509 mlx90632_calc_ambient_dsp105()
error: uninitialized symbol 'ambient_new_raw'.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
index d695ab97d27f..9851311aa3fd 100644
--- a/drivers/iio/temperature/mlx90632.c
+++ b/drivers/iio/temperature/mlx90632.c
@@ -506,6 +506,8 @@ static int mlx90632_calc_ambient_dsp105(struct mlx90632_data *data, int *val)
ret = mlx90632_read_ambient_raw(data->regmap, &ambient_new_raw,
&ambient_old_raw);
+ if (ret < 0)
+ return ret;
*val = mlx90632_calc_temp_ambient(ambient_new_raw, ambient_old_raw,
PT, PR, PG, PO, Gb);
return ret;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] iio temperature/mlx90632: silence a static checker warning
2018-02-22 9:14 [PATCH] iio temperature/mlx90632: silence a static checker warning Dan Carpenter
@ 2018-02-22 9:26 ` Crt Mori
2018-02-24 13:35 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Crt Mori @ 2018-02-22 9:26 UTC (permalink / raw)
To: Dan Carpenter
Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, Linux Iio, kernel-janitors
OK, makes sense.
Acked-by: Crt Mori <cmo@melexis.com>
On 22 February 2018 at 10:14, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> This shouldn't affect runtime at all, but Smatch complains that we
> should check if mlx90632_read_ambient_raw() otherwise we
> "ambient_new_raw" can be uninitialized.
>
> drivers/iio/temperature/mlx90632.c:509 mlx90632_calc_ambient_dsp105()
> error: uninitialized symbol 'ambient_new_raw'.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
> index d695ab97d27f..9851311aa3fd 100644
> --- a/drivers/iio/temperature/mlx90632.c
> +++ b/drivers/iio/temperature/mlx90632.c
> @@ -506,6 +506,8 @@ static int mlx90632_calc_ambient_dsp105(struct mlx90632_data *data, int *val)
>
> ret = mlx90632_read_ambient_raw(data->regmap, &ambient_new_raw,
> &ambient_old_raw);
> + if (ret < 0)
> + return ret;
> *val = mlx90632_calc_temp_ambient(ambient_new_raw, ambient_old_raw,
> PT, PR, PG, PO, Gb);
> return ret;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iio temperature/mlx90632: silence a static checker warning
2018-02-22 9:26 ` Crt Mori
@ 2018-02-24 13:35 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2018-02-24 13:35 UTC (permalink / raw)
To: Crt Mori
Cc: Dan Carpenter, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, Linux Iio, kernel-janitors
On Thu, 22 Feb 2018 10:26:17 +0100
Crt Mori <cmo@melexis.com> wrote:
> OK, makes sense.
>
> Acked-by: Crt Mori <cmo@melexis.com>
>
Applied to the togreg branch of iio.git and pushed out as testing.
Thanks,
Jonathan
> On 22 February 2018 at 10:14, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> >
> > This shouldn't affect runtime at all, but Smatch complains that we
> > should check if mlx90632_read_ambient_raw() otherwise we
> > "ambient_new_raw" can be uninitialized.
> >
> > drivers/iio/temperature/mlx90632.c:509 mlx90632_calc_ambient_dsp105()
> > error: uninitialized symbol 'ambient_new_raw'.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
> > index d695ab97d27f..9851311aa3fd 100644
> > --- a/drivers/iio/temperature/mlx90632.c
> > +++ b/drivers/iio/temperature/mlx90632.c
> > @@ -506,6 +506,8 @@ static int mlx90632_calc_ambient_dsp105(struct mlx90632_data *data, int *val)
> >
> > ret = mlx90632_read_ambient_raw(data->regmap, &ambient_new_raw,
> > &ambient_old_raw);
> > + if (ret < 0)
> > + return ret;
> > *val = mlx90632_calc_temp_ambient(ambient_new_raw, ambient_old_raw,
> > PT, PR, PG, PO, Gb);
> > return ret;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-02-24 13:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-22 9:14 [PATCH] iio temperature/mlx90632: silence a static checker warning Dan Carpenter
2018-02-22 9:26 ` Crt Mori
2018-02-24 13:35 ` Jonathan Cameron
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).