usbip: convert sysfs snprintf to sysfs_emit
Subsystems (2)
PATCH 1/1 usbip: convert sysfs snprintf to sysfs_emit
From: Xuezhi Zhang <[email protected]>
Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space.
Signed-off-by Xuezhi Zhang <[email protected]>
--- drivers/usb/usbip/stub_dev.c | 2 +- drivers/usb/usbip/vudc_sysfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/usb/usbip/stub_dev.c +1 -1
@@ -30,7 +30,7 @@ static ssize_t usbip_status_show(struct device *dev, status = sdev->ud.status;spin_unlock_irq (&sdev->ud.lock); -return snprintf (buf,PAGE_SIZE ,"%d\n" , status); +return sysfs_emit (buf,"%d\n" , status); }static DEVICE_ATTR_RO (usbip_status);
drivers/usb/usbip/vudc_sysfs.c +1 -1
@@ -242,7 +242,7 @@ static ssize_t usbip_status_show(struct device *dev, status = udc->ud.status;spin_unlock_irq (&udc->ud.lock); -return snprintf (out,PAGE_SIZE ,"%d\n" , status); +return sysfs_emit (out,"%d\n" , status); }static DEVICE_ATTR_RO (usbip_status);
Signature · 1 line
2.25.1
Quoted 8 lines · Xuezhi Zhang
From: Xuezhi Zhang <[email protected]>
Follow the advice of the
Documentation/filesystems/sysfs.rstandshow()should only usesysfs_emit()orsysfs_emit_at()when formatting the value to be returned to user space.Signed-off-by Xuezhi Zhang <[email protected]>---
Looks good to me.
Reviewed-by Shuah Khan <[email protected]>
Greg, Please pick this up.
thanks,
-- Shuah