]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: imu: smi330: remove redundant assignment in smi330_read_avail
authorMassimiliano Pellizzer <mpellizzer.dev@gmail.com>
Tue, 25 Nov 2025 17:18:16 +0000 (18:18 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 21 Dec 2025 11:41:12 +0000 (11:41 +0000)
In the IIO_CHAN_INFO_OVERSAMPLING_RATIO case, the type parameter
is assigned from smi330_average_attr.type and then immediately
overwritten with IIO_VAL_INT on the next line.

Since smi330_average_attr.type is already initialized to IIO_VAL_INT,
the second assignment is redundant. Remove the hardcoded assignment
to maintain consistency in the code.

Signed-off-by: Massimiliano Pellizzer <mpellizzer.dev@gmail.com>
Reviewed-by: Jianping Shen <Jianping.Shen@de.bosch.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/smi330/smi330_core.c

index 7564f12543e0ca04ae9c60441f8122e8e2192114..0cf673b44b6291b8b811e541bd3a18737c27b95f 100644 (file)
@@ -475,7 +475,6 @@ static int smi330_read_avail(struct iio_dev *indio_dev,
                *vals = smi330_average_attr.vals;
                *length = smi330_average_attr.len;
                *type = smi330_average_attr.type;
-               *type = IIO_VAL_INT;
                return IIO_AVAIL_LIST;
        case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY:
                *vals = smi330_bandwidth_attr.vals;