From: "Winkler, Tomas" <tomas.winkler@intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Usyskin, Alexander" <alexander.usyskin@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [char-misc-next 1/6] mei: use sprintf in tx_queue_limit_show sysfs
Date: Sat, 6 Feb 2021 14:58:43 +0000 [thread overview]
Message-ID: <32de2e88c66d467fb2eafe8d20bc280d@intel.com> (raw)
In-Reply-To: <YB6r1HcHjEQpseaM@kroah.com>
> On Sat, Feb 06, 2021 at 04:43:20PM +0200, Tomas Winkler wrote:
> > Using of snprintf is discouraged in sysfs.
> > For simple u8 it is safe to use sprintf.
> >
> > Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> > ---
> > drivers/misc/mei/main.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index
> > 9f6682033ed7..24a05f45b639 100644
> > --- a/drivers/misc/mei/main.c
> > +++ b/drivers/misc/mei/main.c
> > @@ -1026,7 +1026,7 @@ static ssize_t tx_queue_limit_show(struct device
> *device,
> > size = dev->tx_queue_limit;
> > mutex_unlock(&dev->device_lock);
> >
> > - return snprintf(buf, PAGE_SIZE, "%u\n", size);
> > + return sprintf(buf, "%u\n", size);
>
> If you are going to do this, why not just convert it to use sysfs_emit()
> instead?
I thought it's an overkill, but if you prefer that I will resubmit.
Thanks
Tomas
prev parent reply other threads:[~2021-02-06 14:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-06 14:43 [char-misc-next 1/6] mei: use sprintf in tx_queue_limit_show sysfs Tomas Winkler
2021-02-06 14:43 ` [char-misc-next 2/6] mei: allow clients on bus to communicate in remove callback Tomas Winkler
2021-02-06 14:43 ` [char-misc-next 3/6] mei: add support for client dma capability Tomas Winkler
2021-02-06 14:43 ` [char-misc-next 4/6] mei: hbm: add client dma hbm messages Tomas Winkler
2021-02-06 14:43 ` [char-misc-next 5/6] mei: implement client dma setup Tomas Winkler
2021-02-06 14:43 ` [char-misc-next 6/6] mei: bus: add client dma interface Tomas Winkler
2021-02-06 14:48 ` Greg Kroah-Hartman
2021-02-06 15:04 ` Winkler, Tomas
2021-02-06 16:30 ` Greg Kroah-Hartman
2021-02-07 14:03 ` Winkler, Tomas
2021-02-07 14:33 ` Greg Kroah-Hartman
2021-02-07 19:04 ` Grumbach, Emmanuel
2021-02-06 14:46 ` [char-misc-next 1/6] mei: use sprintf in tx_queue_limit_show sysfs Greg Kroah-Hartman
2021-02-06 14:58 ` Winkler, Tomas [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=32de2e88c66d467fb2eafe8d20bc280d@intel.com \
--to=tomas.winkler@intel.com \
--cc=alexander.usyskin@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/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