[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fae1a43259879b797bb13ac8dcc2579246977b2e.camel@perches.com>
Date: Mon, 18 Oct 2021 07:20:39 -0700
From: Joe Perches <joe@...ches.com>
To: Vineeth Vijayan <vneethv@...ux.ibm.com>,
Qing Wang <wangqing@...o.com>,
Stefan Haberland <sth@...ux.ibm.com>,
Jan Hoeppner <hoeppner@...ux.ibm.com>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ibm.com>,
Peter Oberparleiter <oberpar@...ux.ibm.com>,
linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] s390: replace snprintf in show functions with
sysfs_emit
On Mon, 2021-10-18 at 13:50 +0200, Vineeth Vijayan wrote:
> Acked-by: Vineeth Vijayan <vneethv@...ux.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...
Powered by blists - more mailing lists