Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usbip: convert sysfs snprintf to sysfs_emit

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 <zhangxuezhi1@coolpad.com>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20221014110606.599352-1-zhangxuezhi3@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Xuezhi Zhang and committed by
Greg Kroah-Hartman
27ef01e3 13cc02f1

+1 -1
+1 -1
drivers/usb/usbip/stub_dev.c
··· 30 30 status = sdev->ud.status; 31 31 spin_unlock_irq(&sdev->ud.lock); 32 32 33 - return snprintf(buf, PAGE_SIZE, "%d\n", status); 33 + return sysfs_emit(buf, "%d\n", status); 34 34 } 35 35 static DEVICE_ATTR_RO(usbip_status); 36 36