mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: hanyu001@208suo.com
To: jejb@linux.ibm.com, martin.petersen@oracle.com
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Fwd: [PATCH] scsi: isci:  Convert snprintf() to sysfs_emit()
Date: Thu, 13 Jul 2023 14:45:50 +0800	[thread overview]
Message-ID: <9983c57b3af01ba23f482c680ad82698@208suo.com> (raw)
In-Reply-To: <tencent_9AA2345A885AECF32201BDEABACAB9F12707@qq.com>

Coccinnelle reports a warning
Warning: Use scnprintf or sprintf

WARNING: use scnprintf or sprintf
Signed-off-by: ztt <1549089851@qq.com>
---
  drivers/scsi/isci/init.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c
index ac1e04b86d8f..5ce24fc7f940 100644
--- a/drivers/scsi/isci/init.c
+++ b/drivers/scsi/isci/init.c
@@ -137,7 +137,7 @@ static ssize_t isci_show_id(struct device *dev, 
struct device_attribute *attr, c
      struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost);
      struct isci_host *ihost = container_of(sas_ha, typeof(*ihost), 
sas_ha);

-    return snprintf(buf, PAGE_SIZE, "%d\n", ihost->id);
+    return scnprintf(buf, PAGE_SIZE, "%d\n", ihost->id);
  }

  static DEVICE_ATTR(isci_id, S_IRUGO, isci_show_id, NULL);

           reply	other threads:[~2023-07-13  6:46 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <tencent_9AA2345A885AECF32201BDEABACAB9F12707@qq.com>]

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=9983c57b3af01ba23f482c680ad82698@208suo.com \
    --to=hanyu001@208suo.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®