Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <matteomartelli3@gmail.com>
Link: https://patch.msgid.link/20240730-iio-clean-fmt-value-v1-1-3e1c3deafc33@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Matteo Martelli and committed by
Jonathan Cameron
1e2ae3ce 6f055df6

-1
-1
drivers/iio/industrialio-core.c
··· 667 667 vals[1]); 668 668 case IIO_VAL_FRACTIONAL: 669 669 tmp2 = div_s64((s64)vals[0] * 1000000000LL, vals[1]); 670 - tmp1 = vals[1]; 671 670 tmp0 = (int)div_s64_rem(tmp2, 1000000000, &tmp1); 672 671 if ((tmp2 < 0) && (tmp0 == 0)) 673 672 return sysfs_emit_at(buf, offset, "-0.%09u", abs(tmp1));