[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <21e2111f6c2590ac24ad15d39e87160f9425045b.1638186054.git.yang.guang5@zte.com.cn>
Date: Tue, 30 Nov 2021 08:07:21 +0800
From: davidcomponentone@...il.com
To: TheSven73@...il.com
Cc: davidcomponentone@...il.com, gregkh@...uxfoundation.org,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
Yang Guang <yang.guang5@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] staging: replace snprintf with sysfs_emit
From: Yang Guang <yang.guang5@....com.cn>
coccinelle report:
./drivers/staging/fieldbus/dev_core.c:73:8-16:
WARNING: use scnprintf or sprintf
Use sysfs_emit instead of scnprintf or sprintf makes more sense.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Yang Guang <yang.guang5@....com.cn>
---
drivers/staging/fieldbus/dev_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/fieldbus/dev_core.c b/drivers/staging/fieldbus/dev_core.c
index 5aab734606ea..01862fe8e4cc 100644
--- a/drivers/staging/fieldbus/dev_core.c
+++ b/drivers/staging/fieldbus/dev_core.c
@@ -70,7 +70,7 @@ static ssize_t card_name_show(struct device *dev, struct device_attribute *attr,
* card_name was provided by child driver, could potentially be long.
* protect against buffer overrun.
*/
- return snprintf(buf, PAGE_SIZE, "%s\n", fb->card_name);
+ return sysfs_emit(buf, "%s\n", fb->card_name);
}
static DEVICE_ATTR_RO(card_name);
--
2.30.2
Powered by blists - more mailing lists