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-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Fwd: [PATCH] scsi: fcoe: convert snprintf to sysfs_emit
Date: Fri, 14 Jul 2023 16:00:15 +0800	[thread overview]
Message-ID: <38822ed80288fd808c17dc5a962895b1@208suo.com> (raw)
In-Reply-To: <tencent_B92BA21DDAA55A94730701A8EAB44A877107@qq.com>

Fix the following coccicheck warning:
drivers/gpu/drm/i915//i915_sysfs.c:266:8-16:
WARNING: use scnprintf or sprintf
drivers/gpu/drm/i915//i915_sysfs.c:285:8-16:
WARNING: use scnprintf or sprintf
drivers/gpu/drm/i915//i915_sysfs.c:276:8-16:
WARNING: use scnprintf or sprintf
drivers/gpu/drm/i915//i915_sysfs.c:335:8-16:
WARNING: use scnprintf or sprintf
drivers/gpu/drm/i915//i915_sysfs.c:390:8-16:
WARNING: use scnprintf or sprintf
drivers/gpu/drm/i915//i915_sysfs.c:465:8-16:
WARNING: use scnprintf or sprintf
drivers/gpu/drm/i915//i915_sysfs.c:107:8-16:
WARNING: use scnprintf or sprintf
drivers/gpu/drm/i915//i915_sysfs.c:75:8-16:
WARNING: use scnprintf or sprintf
drivers/gpu/drm/i915//i915_sysfs.c:83:8-16:
WARNING: use scnprintf or sprintf
drivers/gpu/drm/i915//i915_sysfs.c:91:8-16:
WARNING: use scnprintf or sprintf
drivers/gpu/drm/i915//i915_sysfs.c:99:8-16:
WARNING: use scnprintf or sprintf
drivers/gpu/drm/i915//i915_sysfs.c:326:8-16:
WARNING: use scnprintf or sprintf

./drivers/scsi/fcoe/fcoe_sysfs.c:376:8-16: WARNING: use scnprintf or 
sprintf
./drivers/scsi/fcoe/fcoe_sysfs.c:268:8-16: WARNING: use scnprintf or 
sprintf
./drivers/scsi/fcoe/fcoe_sysfs.c:253:8-16: WARNING: use scnprintf or 
sprintf

Signed-off-by: ztt <1549089851@qq.com>
---
  drivers/scsi/fcoe/fcoe_sysfs.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c 
b/drivers/scsi/fcoe/fcoe_sysfs.c
index e17957f8085c..434ef662cfd4 100644
--- a/drivers/scsi/fcoe/fcoe_sysfs.c
+++ b/drivers/scsi/fcoe/fcoe_sysfs.c
@@ -250,7 +250,7 @@ static ssize_t show_fcf_state(struct device *dev,
      name = get_fcoe_fcf_state_name(fcf->state);
      if (!name)
          return -EINVAL;
-    return snprintf(buf, FCOE_FCF_STATE_MAX_NAMELEN, "%s\n", name);
+    return scnprintf(buf, FCOE_FCF_STATE_MAX_NAMELEN, "%s\n", name);
  }
  static FCOE_DEVICE_ATTR(fcf, state, S_IRUGO, show_fcf_state, NULL);

@@ -265,7 +265,7 @@ static ssize_t show_ctlr_mode(struct device *dev,
      name = get_fcoe_ctlr_mode_name(ctlr->mode);
      if (!name)
          return -EINVAL;
-    return snprintf(buf, FCOE_MAX_MODENAME_LEN,
+    return scnprintf(buf, FCOE_MAX_MODENAME_LEN,
              "%s\n", name);
  }

@@ -373,7 +373,7 @@ static ssize_t show_ctlr_enabled_state(struct device 
*dev,
      name = get_fcoe_ctlr_enabled_state_name(ctlr->enabled);
      if (!name)
          return -EINVAL;
-    return snprintf(buf, FCOE_CTLR_ENABLED_MAX_NAMELEN,
+    return scnprintf(buf, FCOE_CTLR_ENABLED_MAX_NAMELEN,
              "%s\n", name);
  }

           reply	other threads:[~2023-07-14  8:03 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <tencent_B92BA21DDAA55A94730701A8EAB44A877107@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=38822ed80288fd808c17dc5a962895b1@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®