mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: hanyu001@208suo.com
To: stuyoder@gmail.com, laurentiu.tudor@nxp.com
Cc: linux-kernel@vger.kernel.org
Subject: Fwd: [PATCH] bus: fsl-mc: replace snprintf in show functions with sysfs_emit
Date: Thu, 13 Jul 2023 17:58:48 +0800	[thread overview]
Message-ID: <dcf60154f976e9457a937e20626d0a6a@208suo.com> (raw)
In-Reply-To: <tencent_FA44C0B483B542E72F0227D54F9516E3EA08@qq.com>

show() should not use snprintf() when formatting the value to be
returned to user space.

Fix the following coccicheck warning:
drivers/media/i2c/ccs/ccs-core.c:3761: WARNING: use scnprintf or 
sprintf.

./drivers/bus/fsl-mc/fsl-mc-bus.c:204:8-16: WARNING: use scnprintf or 
sprintf

Signed-off-by: ztt <1549089851@qq.com>
---
  drivers/bus/fsl-mc/fsl-mc-bus.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c 
b/drivers/bus/fsl-mc/fsl-mc-bus.c
index 4352745a923c..c28bde570cb1 100644
--- a/drivers/bus/fsl-mc/fsl-mc-bus.c
+++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
@@ -201,7 +201,7 @@ static ssize_t driver_override_show(struct device 
*dev,
  {
      struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);

-    return snprintf(buf, PAGE_SIZE, "%s\n", mc_dev->driver_override);
+    return scnprintf(buf, PAGE_SIZE, "%s\n", mc_dev->driver_override);
  }
  static DEVICE_ATTR_RW(driver_override);

           reply	other threads:[~2023-07-13  9:59 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <tencent_FA44C0B483B542E72F0227D54F9516E3EA08@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=dcf60154f976e9457a937e20626d0a6a@208suo.com \
    --to=hanyu001@208suo.com \
    --cc=laurentiu.tudor@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stuyoder@gmail.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®