The 'type' argument was passed by the only caller of the iio_channel_read_max() function as a pointer to return an extra value, but the value of the variable passed by the caller was never read afterwards. Signed-off-by: Paul Cercueil <paul@xxxxxxxxxxxxxxx> --- drivers/iio/inkern.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index df74765d33dc..e8a25852f0df 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -813,21 +813,22 @@ int iio_read_avail_channel_raw(struct iio_channel *chan, EXPORT_SYMBOL_GPL(iio_read_avail_channel_raw); static int iio_channel_read_max(struct iio_channel *chan, - int *val, int *val2, int *type, + int *val, int *val2, enum iio_chan_info_enum info) { int unused; const int *vals; int length; int ret; + int type; if (!val2) val2 = &unused; - ret = iio_channel_read_avail(chan, &vals, type, &length, info); + ret = iio_channel_read_avail(chan, &vals, &type, &length, info); switch (ret) { case IIO_AVAIL_RANGE: - switch (*type) { + switch (type) { case IIO_VAL_INT: *val = vals[2]; break; @@ -840,7 +841,7 @@ static int iio_channel_read_max(struct iio_channel *chan, case IIO_AVAIL_LIST: if (length <= 0) return -EINVAL; - switch (*type) { + switch (type) { case IIO_VAL_INT: *val = vals[--length]; while (length) { @@ -863,7 +864,6 @@ int iio_read_max_channel_raw(struct iio_channel *chan, int *val) { struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(chan->indio_dev); int ret; - int type; mutex_lock(&iio_dev_opaque->info_exist_lock); if (!chan->indio_dev->info) { @@ -871,7 +871,7 @@ int iio_read_max_channel_raw(struct iio_channel *chan, int *val) goto err_unlock; } - ret = iio_channel_read_max(chan, val, NULL, &type, IIO_CHAN_INFO_RAW); + ret = iio_channel_read_max(chan, val, NULL, IIO_CHAN_INFO_RAW); err_unlock: mutex_unlock(&iio_dev_opaque->info_exist_lock); -- 2.35.1