Skip to contentSkip to conversation

USB: usbsevseg: convert sysfs snprintf to sysfs_emit

PATCH New Xuezhi Zhang 1 participant 1 message Jul 27, 2022 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: usbsevseg: convert sysfs snprintf to sysfs_emit

From: Xuezhi Zhang <[email protected]>

Fix the following coccincheck warning:
drivers/usb/misc/usbsevseg.c:170:8-16:
WARNING: use scnprintf or sprintf

---
 drivers/usb/misc/usbsevseg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/misc/usbsevseg.c +1 -1
index 4bc816bb09bb..c3114d9bd128 100644
@@ -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,
Signature · 1 line
2.34.1