[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260131160111.3161630-2-krishna.kurapati@oss.qualcomm.com>
Date: Sat, 31 Jan 2026 21:31:10 +0530
From: Krishna Kurapati <krishna.kurapati@....qualcomm.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Al Viro <viro@...iv.linux.org.uk>, Sam Day <me@...cday.com>,
Christian Brauner <brauner@...nel.org>, Chen Ni <nichen@...as.ac.cn>,
Mateusz Guzik <mjguzik@...il.com>, Liang Jie <liangjie@...iang.com>,
Ingo Rohloff <ingo.rohloff@...terbach.com>,
Owen Gu <guhuinan@...omi.com>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
Krishna Kurapati <krishna.kurapati@....qualcomm.com>
Subject: [PATCH 1/2] usb: gadget: f_fs: Use sysfs_emit() in configfs show function
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@....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
Powered by blists - more mailing lists