mirror of
https://github.com/torvalds/linux.git
synced 2026-03-14 02:06:15 +01: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
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue