[PATCH 1/2] usb: gadget: f_fs: Use sysfs_emit() in configfs show function

Krishna Kurapati posted 2 patches 1 week, 1 day ago
[PATCH 1/2] usb: gadget: f_fs: Use sysfs_emit() in configfs show function
Posted by Krishna Kurapati 1 week, 1 day ago
Use sysfs_emit() instead of sprintf() in configfs attribute show function.
sysfs_emit() is the recommended API for sysfs output as it provides buffer
overflow protection and proper formatting.

No functional changes.

Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
 drivers/usb/gadget/function/f_fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index c1826aa2f0f8..80dd42a7f391 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -3981,7 +3981,7 @@ static ssize_t f_fs_opts_ready_show(struct config_item *item, char *page)
 	ready = opts->dev->desc_ready;
 	ffs_dev_unlock();
 
-	return sprintf(page, "%d\n", ready);
+	return sysfs_emit(page, "%d\n", ready);
 }
 
 CONFIGFS_ATTR_RO(f_fs_opts_, ready);
-- 
2.34.1