mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 02:33:57 +00:00
iio: common: scmi_iio: use sysfs_emit() to instead of scnprintf()
Replace the open-code with sysfs_emit() to simplify the code. Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/202212011156314630626@zte.com.cn Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
7ae267954a
commit
f9e51aacc7
@ -400,12 +400,12 @@ static ssize_t scmi_iio_get_raw_available(struct iio_dev *iio_dev,
|
||||
rem = do_div(resolution,
|
||||
int_pow(10, abs(exponent))
|
||||
);
|
||||
len = scnprintf(buf, PAGE_SIZE,
|
||||
len = sysfs_emit(buf,
|
||||
"[%lld %llu.%llu %lld]\n", min_range,
|
||||
resolution, rem, max_range);
|
||||
} else {
|
||||
resolution = resolution * int_pow(10, exponent);
|
||||
len = scnprintf(buf, PAGE_SIZE, "[%lld %llu %lld]\n",
|
||||
len = sysfs_emit(buf, "[%lld %llu %lld]\n",
|
||||
min_range, resolution, max_range);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user