All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] HID: wacom: convert sysfs sprintf/snprintf family to sysfs_emit
@ 2021-02-02  8:19 Jiapeng Chong
  2021-02-05  9:17 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2021-02-02  8:19 UTC (permalink / raw)
  To: jikos; +Cc: benjamin.tissoires, linux-input, linux-kernel, Jiapeng Chong

Fix the following coccicheck warning:

./drivers/hid/wacom_sys.c:1828:8-16: WARNING: use scnprintf or sprintf.

Reported-by: Abaci Robot<abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/hid/wacom_sys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index aa9e488..8328ef1 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -1825,7 +1825,7 @@ static ssize_t wacom_show_speed(struct device *dev,
 	struct hid_device *hdev = to_hid_device(dev);
 	struct wacom *wacom = hid_get_drvdata(hdev);
 
-	return snprintf(buf, PAGE_SIZE, "%i\n", wacom->wacom_wac.bt_high_speed);
+	return sysfs_emit(buf, "%i\n", wacom->wacom_wac.bt_high_speed);
 }
 
 static ssize_t wacom_store_speed(struct device *dev,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: wacom: convert sysfs sprintf/snprintf family to sysfs_emit
  2021-02-02  8:19 [PATCH] HID: wacom: convert sysfs sprintf/snprintf family to sysfs_emit Jiapeng Chong
@ 2021-02-05  9:17 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2021-02-05  9:17 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: benjamin.tissoires, linux-input, linux-kernel

On Tue, 2 Feb 2021, Jiapeng Chong wrote:

> Fix the following coccicheck warning:
> 
> ./drivers/hid/wacom_sys.c:1828:8-16: WARNING: use scnprintf or sprintf.
> 
> Reported-by: Abaci Robot<abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/hid/wacom_sys.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
> index aa9e488..8328ef1 100644
> --- a/drivers/hid/wacom_sys.c
> +++ b/drivers/hid/wacom_sys.c
> @@ -1825,7 +1825,7 @@ static ssize_t wacom_show_speed(struct device *dev,
>  	struct hid_device *hdev = to_hid_device(dev);
>  	struct wacom *wacom = hid_get_drvdata(hdev);
>  
> -	return snprintf(buf, PAGE_SIZE, "%i\n", wacom->wacom_wac.bt_high_speed);
> +	return sysfs_emit(buf, "%i\n", wacom->wacom_wac.bt_high_speed);
>  }

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-05  9:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02  8:19 [PATCH] HID: wacom: convert sysfs sprintf/snprintf family to sysfs_emit Jiapeng Chong
2021-02-05  9:17 ` Jiri Kosina

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.