From: Matteo Martelli Date: Tue, 30 Jul 2024 09:43:49 +0000 (+0200) Subject: iio: remove unneeded assignment in __iio_format_value X-Git-Tag: v6.12-rc1~39^2~37^2~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1e2ae3ce23b35bb8fa81624501b2f697b73afef3;p=thirdparty%2Fkernel%2Flinux.git iio: remove unneeded assignment in __iio_format_value Trivial cleanup in __iio_format_value() for the IIO_VAL_FRACTIONAL case where tmp1 = vals[1] assignment is unneeded and irrelevant since tmp1 is immediately overwritten by the subsequent div_s64_rem() call. Signed-off-by: Matteo Martelli Link: https://patch.msgid.link/20240730-iio-clean-fmt-value-v1-1-3e1c3deafc33@gmail.com Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index f18f48c7eb037..3f2bc6451325e 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -667,7 +667,6 @@ static ssize_t __iio_format_value(char *buf, size_t offset, unsigned int type, vals[1]); case IIO_VAL_FRACTIONAL: tmp2 = div_s64((s64)vals[0] * 1000000000LL, vals[1]); - tmp1 = vals[1]; tmp0 = (int)div_s64_rem(tmp2, 1000000000, &tmp1); if ((tmp2 < 0) && (tmp0 == 0)) return sysfs_emit_at(buf, offset, "-0.%09u", abs(tmp1));