[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b43d2cf8dd0e2721a5b834a660bd35633bc82436.camel@ozlabs.org>
Date: Mon, 23 Aug 2021 09:12:44 +0800
From: Jeremy Kerr <jk@...abs.org>
To: CGEL <cgel.zte@...il.com>
Cc: Joel Stanley <joel@....id.au>,
Alistar Popple <alistair@...ple.id.au>,
Eddie James <eajames@...ux.ibm.com>,
linux-fsi@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
jing yangyang <jing.yangyang@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH linux-next] fsi:(fsi-master-gpio)Convert sysfs
sprintf/snprintf family to sysfs_emit
Hi,
> Fix the following coccicheck warning:
> ./drivers/fsi/fsi-master-gpio.c:721:8-16:WARNING:use scnprintf or
> sprintf
Looks good, but we may as well do the other cases (in fsi-core) at the
same time.
There's a cocci script in the initial sysfs_emit series:
https://lore.kernel.org/lkml/c22b7006813b1776467a72e716a5970e9277b4b7.camel@perches.com/
Which gives me these additional changes:
diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index 59ddc9fd5bca..159db87a043d 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -818,7 +818,7 @@ static ssize_t slave_send_echo_show(struct device *dev,
{
struct fsi_slave *slave = to_fsi_slave(dev);
- return sprintf(buf, "%u\n", slave->t_send_delay);
+ return sysfs_emit(buf, "%u\n", slave->t_send_delay);
}
static ssize_t slave_send_echo_store(struct device *dev,
@@ -862,7 +862,7 @@ static ssize_t chip_id_show(struct device *dev,
{
struct fsi_slave *slave = to_fsi_slave(dev);
- return sprintf(buf, "%d\n", slave->chip_id);
+ return sysfs_emit(buf, "%d\n", slave->chip_id);
}
static DEVICE_ATTR_RO(chip_id);
@@ -873,7 +873,7 @@ static ssize_t cfam_id_show(struct device *dev,
{
struct fsi_slave *slave = to_fsi_slave(dev);
- return sprintf(buf, "0x%x\n", slave->cfam_id);
+ return sysfs_emit(buf, "0x%x\n", slave->cfam_id);
}
static DEVICE_ATTR_RO(cfam_id);
Do you want to include these in your patch too?
Cheers,
Jeremy
Powered by blists - more mailing lists