From: Joe Perches <joe@perches.com>
To: Vineeth Vijayan <vneethv@linux.ibm.com>,
Qing Wang <wangqing@vivo.com>,
Stefan Haberland <sth@linux.ibm.com>,
Jan Hoeppner <hoeppner@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Peter Oberparleiter <oberpar@linux.ibm.com>,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] s390: replace snprintf in show functions with sysfs_emit
Date: Mon, 18 Oct 2021 07:20:39 -0700 [thread overview]
Message-ID: <fae1a43259879b797bb13ac8dcc2579246977b2e.camel@perches.com> (raw)
In-Reply-To: <2b1b939e1ea960c2268791f3007305955a70a90f.camel@linux.ibm.com>
On Mon, 2021-10-18 at 13:50 +0200, Vineeth Vijayan wrote:
> Acked-by: Vineeth Vijayan <vneethv@linux.ibm.com>
[]
> On Thu, 2021-10-14 at 23:50 -0700, Qing Wang wrote:
> > show() must not use snprintf() when formatting the value to be
> > returned to user space.
[]
> > diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
[]
> > @@ -731,7 +731,7 @@ static ssize_t dasd_ff_show(struct device *dev,
[]
> > - return snprintf(buf, PAGE_SIZE, ff_flag ? "1\n" : "0\n");
> > + return sysfs_emit(buf, ff_flag ? "1\n" : "0\n");
It's more common to use
return sysfs_emit(buf, "%d\n", ff_flag);
> > @@ -773,7 +773,7 @@ dasd_ro_show(struct device *dev, struct
[]
> > - return snprintf(buf, PAGE_SIZE, ro_flag ? "1\n" : "0\n");
> > + return sysfs_emit(buf, ro_flag ? "1\n" : "0\n");
etc...
next prev parent reply other threads:[~2021-10-18 18:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-15 6:50 [PATCH] s390: replace snprintf in show functions with sysfs_emit Qing Wang
2021-10-18 10:48 ` Heiko Carstens
2021-10-18 11:50 ` Vineeth Vijayan
2021-10-18 14:20 ` Joe Perches [this message]
2021-10-20 14:44 ` Stefan Haberland
2021-11-10 15:19 ` Heiko Carstens
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=fae1a43259879b797bb13ac8dcc2579246977b2e.camel@perches.com \
--to=joe@perches.com \
--cc=borntraeger@de.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=hoeppner@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=oberpar@linux.ibm.com \
--cc=sth@linux.ibm.com \
--cc=vneethv@linux.ibm.com \
--cc=wangqing@vivo.com \
/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