From: Shankari Anand <shankari.ak0208@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: James.Bottomley@hansenpartnership.com, martin.petersen@oracle.com
Subject: Re: [PATCH] scsi: sysfs: replace scnprintf() with sysfs_emit() in sdev_show_blacklist()
Date: Fri, 27 Jun 2025 11:19:13 +0530 [thread overview]
Message-ID: <CAPRMd3kWNoUpu-wJQG43R_C-h2Npc_5AYieS_sKrHr-wEa_Z6w@mail.gmail.com> (raw)
In-Reply-To: <20250620105344.455283-1-shankari.ak0208@gmail.com>
Hi,
I wanted to kindly follow up and ask if this patch could be picked up
for review. Please let me know if there’s anything I should revise
Thanks!
On Fri, Jun 20, 2025 at 4:23 PM Shankari Anand
<shankari.ak0208@gmail.com> wrote:
>
> Documentation/filesystems/sysfs.rst mentions that show() should only
> use sysfs_emit() or sysfs_emit_at() when formating the value to be
> returned to user space. So replace scnprintf() with sysfs_emit().
>
> Signed-off-by: Shankari Anand <shankari.ak0208@gmail.com>
> ---
> drivers/scsi/scsi_sysfs.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
> index d772258e29ad..074b02e4cf9e 100644
> --- a/drivers/scsi/scsi_sysfs.c
> +++ b/drivers/scsi/scsi_sysfs.c
> @@ -1095,14 +1095,14 @@ sdev_show_blacklist(struct device *dev, struct device_attribute *attr,
> name = sdev_bflags_name[i];
>
> if (name)
> - len += scnprintf(buf + len, PAGE_SIZE - len,
> + len += sysfs_emit(buf + len,
> "%s%s", len ? " " : "", name);
> else
> - len += scnprintf(buf + len, PAGE_SIZE - len,
> + len += sysfs_emit(buf + len,
> "%sINVALID_BIT(%d)", len ? " " : "", i);
> }
> if (len)
> - len += scnprintf(buf + len, PAGE_SIZE - len, "\n");
> + len += sysfs_emit(buf + len, "\n");
> return len;
> }
> static DEVICE_ATTR(blacklist, S_IRUGO, sdev_show_blacklist, NULL);
> --
> 2.34.1
>
next prev parent reply other threads:[~2025-06-27 5:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-20 10:53 [PATCH] scsi: sysfs: replace scnprintf() with sysfs_emit() in sdev_show_blacklist() Shankari Anand
2025-06-27 5:49 ` Shankari Anand [this message]
2025-06-27 20:53 ` Bart Van Assche
2025-07-02 6:41 ` kernel test robot
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=CAPRMd3kWNoUpu-wJQG43R_C-h2Npc_5AYieS_sKrHr-wEa_Z6w@mail.gmail.com \
--to=shankari.ak0208@gmail.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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;
as well as URLs for NNTP newsgroup(s).