From: Massimiliano Pellizzer <mpellizzer.dev@gmail.com>
To: jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
andy@kernel.org, Jianping.Shen@de.bosch.com
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
Massimiliano Pellizzer <mpellizzer.dev@gmail.com>
Subject: [PATCH] iio: imu: smi330: remove redundant assignment in smi330_read_avail
Date: Tue, 25 Nov 2025 18:18:16 +0100 [thread overview]
Message-ID: <20251125171816.63790-1-mpellizzer.dev@gmail.com> (raw)
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.
Fixes: 6f3d8de8886d ("iio: imu: smi330: Add driver")
Signed-off-by: Massimiliano Pellizzer <mpellizzer.dev@gmail.com>
---
drivers/iio/imu/smi330/smi330_core.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/iio/imu/smi330/smi330_core.c b/drivers/iio/imu/smi330/smi330_core.c
index 7564f12543e0..0cf673b44b62 100644
--- a/drivers/iio/imu/smi330/smi330_core.c
+++ b/drivers/iio/imu/smi330/smi330_core.c
@@ -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;
--
2.52.0
next reply other threads:[~2025-11-25 17:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-25 17:18 Massimiliano Pellizzer [this message]
2025-11-26 9:56 ` AW: [PATCH] iio: imu: smi330: remove redundant assignment in smi330_read_avail Shen Jianping (ME-SE/EAD2)
2025-12-07 18:26 ` 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=20251125171816.63790-1-mpellizzer.dev@gmail.com \
--to=mpellizzer.dev@gmail.com \
--cc=Jianping.Shen@de.bosch.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/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 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).