iio temperature/mlx90632: silence a static checker warning
Subsystems (3)
PATCH 1/1 iio temperature/mlx90632: silence a static checker warning
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'.
drivers/iio/temperature/mlx90632.c +2 -0
@@ -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;
OK, makes sense.
Quoted 23 lines · Dan Carpenter
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:509mlx90632_calc_ambient_dsp105()
error: uninitialized symbol 'ambient_new_raw'.Signed-off-by Dan Carpenter <[email protected]>drivers/iio/temperature/mlx90632.c +2
-0@@ -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;
Jonathan Cameron
maintainerQuoted 4 lines · On Thu, 22 Feb 2018 10:26:17 +0100 Crt Mori <[email protected]> wrote:
OK, makes sense.
Acked-by Crt Mori <[email protected]>
Applied to the togreg branch of iio.git and pushed out as testing.
Thanks,
Jonathan
Quoted 28 lines · Dan Carpenter
Quoted 15 lines
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:509mlx90632_calc_ambient_dsp105()
error: uninitialized symbol 'ambient_new_raw'.Signed-off-by Dan Carpenter <[email protected]>drivers/iio/temperature/mlx90632.c +0
-0drivers/iio/temperature/mlx90632.c static int mlx90632_calc_ambient_dsp105(struct mlx90632_data *data, int *val) · line 513
Quoted 8 lines
drivers/iio/temperature/mlx90632.c +2
-0@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html