projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
df041e7
)
iio:chemical:sps30: Convert sysfs sprintf/snprintf family to sysfs_emit
author
Tian Tao
<tiantao6@hisilicon.com>
Mon, 12 Apr 2021 08:39:09 +0000
(16:39 +0800)
committer
Jonathan Cameron
<Jonathan.Cameron@huawei.com>
Mon, 17 May 2021 12:49:05 +0000
(13:49 +0100)
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>
drivers/iio/chemical/sps30.c
patch
|
blob
|
history
diff --git
a/drivers/iio/chemical/sps30.c
b/drivers/iio/chemical/sps30.c
index 2ea9a5c4d84629c14f92ee2698726b7ea18d3e78..7486591588c3dd3a7a7da4dbd0db5617a394ad2e 100644
(file)
--- 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 s
nprintf(buf, PAGE_SIZE
, "[%d %d %d]\n",
- SPS30_AUTO_CLEANING_PERIOD_MIN, 1,
- SPS30_AUTO_CLEANING_PERIOD_MAX);
+ return s
ysfs_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);