From: Alexandra Winter <wintera@linux.ibm.com>
To: ye.xingchen@zte.com.cn
Cc: wenjia@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com,
agordeev@linux.ibm.com, borntraeger@linux.ibm.com,
svens@linux.ibm.com, linux-s390@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] s390/qeth: use sysfs_emit() to instead of scnprintf()
Date: Mon, 5 Dec 2022 12:38:59 +0100 [thread overview]
Message-ID: <bf5e2905-d37e-7f54-ea2c-b75f2b921679@linux.ibm.com> (raw)
In-Reply-To: <202212051152565871940@zte.com.cn>
On 05.12.22 04:52, ye.xingchen@zte.com.cn wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
>
> Follow the advice of the Documentation/filesystems/sysfs.rst and show()
> should only use sysfs_emit() or sysfs_emit_at() when formatting the
> value to be returned to user space.
>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> ---
> drivers/s390/net/qeth_l3_sys.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c
> index 1082380b21f8..65eea667e469 100644
> --- a/drivers/s390/net/qeth_l3_sys.c
> +++ b/drivers/s390/net/qeth_l3_sys.c
> @@ -395,7 +395,7 @@ static ssize_t qeth_l3_dev_ipato_add_show(char *buf, struct qeth_card *card,
> }
> mutex_unlock(&card->ip_lock);
>
> - return str_len ? str_len : scnprintf(buf, PAGE_SIZE, "\n");
> + return str_len ? str_len : sysfs_emit(buf, "\n");
> }
>
> static ssize_t qeth_l3_dev_ipato_add4_show(struct device *dev,
> @@ -614,7 +614,7 @@ static ssize_t qeth_l3_dev_ip_add_show(struct device *dev, char *buf,
> }
> mutex_unlock(&card->ip_lock);
>
> - return str_len ? str_len : scnprintf(buf, PAGE_SIZE, "\n");
> + return str_len ? str_len : sysfs_emit(buf, "\n");
> }
>
> static ssize_t qeth_l3_dev_vipa_add4_show(struct device *dev,
There are more instances of scnprintf in s390/net that can be replaced by sysfs_emit.
We are already working on that.
But thanks for improving those two.
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
next prev parent reply other threads:[~2022-12-05 11:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-05 3:52 [PATCH net-next] s390/qeth: use sysfs_emit() to instead of scnprintf() ye.xingchen
2022-12-05 11:38 ` Alexandra Winter [this message]
2022-12-05 11:50 ` Alexander Gordeev
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=bf5e2905-d37e-7f54-ea2c-b75f2b921679@linux.ibm.com \
--to=wintera@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=svens@linux.ibm.com \
--cc=wenjia@linux.ibm.com \
--cc=ye.xingchen@zte.com.cn \
/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;
as well as URLs for NNTP newsgroup(s).