summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTian Tao <tiantao6@hisilicon.com>2021-04-12 16:39:09 +0800
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-05-17 13:49:05 +0100
commit643adb9af72e2af62a532590fad0c767045c1e76 (patch)
treeeb37fb37ffcc0af35ee2815548155888dcd8ccf4 /drivers
parentdf041e737a38a316976273281f66fbce2ec4b397 (diff)
iio:chemical:sps30: Convert sysfs sprintf/snprintf family to sysfs_emit
Fix the following coccicheck warning: ./drivers/iio/chemical/sps30.c:414:8-16: WARNING: use scnprintf or sprintf Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Link: https://lore.kernel.org/r/1618216751-1678-2-git-send-email-tiantao6@hisilicon.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iio/chemical/sps30.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iio/chemical/sps30.c b/drivers/iio/chemical/sps30.c
index 2ea9a5c4d846..7486591588c3 100644
--- a/drivers/iio/chemical/sps30.c
+++ b/drivers/iio/chemical/sps30.c
@@ -411,9 +411,9 @@ static ssize_t cleaning_period_available_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- return snprintf(buf, PAGE_SIZE, "[%d %d %d]\n",
- SPS30_AUTO_CLEANING_PERIOD_MIN, 1,
- SPS30_AUTO_CLEANING_PERIOD_MAX);
+ return sysfs_emit(buf, "[%d %d %d]\n",
+ SPS30_AUTO_CLEANING_PERIOD_MIN, 1,
+ SPS30_AUTO_CLEANING_PERIOD_MAX);
}
static IIO_DEVICE_ATTR_WO(start_cleaning, 0);