From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>, Sam Day <me@samcday.com>,
Christian Brauner <brauner@kernel.org>,
Chen Ni <nichen@iscas.ac.cn>, Mateusz Guzik <mjguzik@gmail.com>,
Liang Jie <liangjie@lixiang.com>,
Ingo Rohloff <ingo.rohloff@lauterbach.com>,
Owen Gu <guhuinan@xiaomi.com>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/2] usb: gadget: Use sysfs_emit instead of sprintf
Date: Sun, 1 Feb 2026 11:35:52 +0100 [thread overview]
Message-ID: <2026020125-slighted-fountain-7fe3@gregkh> (raw)
In-Reply-To: <8ed37226-7f03-4d92-a43d-cd538944556a@oss.qualcomm.com>
On Sun, Feb 01, 2026 at 04:01:46PM +0530, Krishna Kurapati wrote:
>
>
> On 2/1/2026 12:58 PM, Greg Kroah-Hartman wrote:
> > On Sat, Jan 31, 2026 at 09:31:09PM +0530, Krishna Kurapati wrote:
> > > Use sysfs_emit() instead of sprintf() in configfs attribute show functions.
> > > sysfs_emit() is the recommended API for sysfs output as it provides buffer
> > > overflow protection and proper formatting.
> >
> > But this isn't sysfs, as you say, it's configfs, so why switch? If
> > there is no need, the churn is not required.
> >
>
> My bad. Its for configfs. I see sysfs_emit being used in configfs show
> functions in f_ncm/u_ether_configfs.h and hence tried to move to the same in
> f_fs and source sink.
You can use it, sure, but there's no need to convert existing code
unless there is a real reason it is required. Just use it for new code
please.
thanks,
greg k-h
prev parent reply other threads:[~2026-02-01 10:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-31 16:01 [PATCH 0/2] usb: gadget: Use sysfs_emit instead of sprintf Krishna Kurapati
2026-01-31 16:01 ` [PATCH 1/2] usb: gadget: f_fs: Use sysfs_emit() in configfs show function Krishna Kurapati
2026-01-31 16:01 ` [PATCH 2/2] usb: gadget: f_sourcesink: Use sysfs_emit() in configfs show functions Krishna Kurapati
2026-02-01 7:28 ` [PATCH 0/2] usb: gadget: Use sysfs_emit instead of sprintf Greg Kroah-Hartman
2026-02-01 10:31 ` Krishna Kurapati
2026-02-01 10:35 ` Greg Kroah-Hartman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2026020125-slighted-fountain-7fe3@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=brauner@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=guhuinan@xiaomi.com \
--cc=ingo.rohloff@lauterbach.com \
--cc=krishna.kurapati@oss.qualcomm.com \
--cc=liangjie@lixiang.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=me@samcday.com \
--cc=mjguzik@gmail.com \
--cc=nichen@iscas.ac.cn \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox