* [PATCH] USB: usbsevseg: convert sysfs snprintf to sysfs_emit
@ 2022-07-27 12:44 Xuezhi Zhang
0 siblings, 0 replies; only message in thread
From: Xuezhi Zhang @ 2022-07-27 12:44 UTC (permalink / raw)
To: gregkh, zhangxuezhi1; +Cc: linux-usb, linux-kernel
From: Xuezhi Zhang <zhangxuezhi1@coolpad.com>
Fix the following coccincheck warning:
drivers/usb/misc/usbsevseg.c:170:8-16:
WARNING: use scnprintf or sprintf
Signed-off-by: Xuezhi Zhang <zhangxuezhi1@coolpad.com>
---
drivers/usb/misc/usbsevseg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/misc/usbsevseg.c b/drivers/usb/misc/usbsevseg.c
index 4bc816bb09bb..c3114d9bd128 100644
--- a/drivers/usb/misc/usbsevseg.c
+++ b/drivers/usb/misc/usbsevseg.c
@@ -167,7 +167,7 @@ static ssize_t text_show(struct device *dev,
struct usb_interface *intf = to_usb_interface(dev);
struct usb_sevsegdev *mydev = usb_get_intfdata(intf);
- return snprintf(buf, mydev->textlength, "%s\n", mydev->text);
+ return sysfs_emit(buf, "%s\n", mydev->text);
}
static ssize_t text_store(struct device *dev,
--
2.34.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-27 12:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-27 12:44 [PATCH] USB: usbsevseg: convert sysfs snprintf to sysfs_emit Xuezhi Zhang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).