mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: hanyu001@208suo.com
To: tglx@linutronix.de, peterz@infradead.org, vschneid@redhat.com,
	dwmw@amazon.co.uk, akpm@linux-foundation.org, npiggin@gmail.com,
	pauld@redhat.com, vdonnefort@google.com,
	gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org
Subject: Fwd: [PATCH] kernel:  convert sysfs snprintf to sysfs_emit
Date: Thu, 13 Jul 2023 17:20:49 +0800	[thread overview]
Message-ID: <ef672732fbb865f338d88db89fc11062@208suo.com> (raw)
In-Reply-To: <tencent_48D17833D10F2D6A2DF87986804C357D2506@qq.com>

Fix the following coccicheck warnings:
drivers/tty/vt/vt.c:3942:8-16:
WARNING: use scnprintf or sprintf
drivers/tty/vt/vt.c:3950:8-16:
WARNING: use scnprintf or sprintf

./kernel/cpu.c:2920:8-16: WARNING: use scnprintf or sprintf
./kernel/cpu.c:2907:8-16: WARNING: use scnprintf or sprintf

Signed-off-by: ztt <1549089851@qq.com>
---
  kernel/cpu.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index ed65aeaa94b5..1a9634236b54 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -2904,7 +2904,7 @@ static ssize_t control_show(struct device *dev,
  {
      const char *state = smt_states[cpu_smt_control];

-    return snprintf(buf, PAGE_SIZE - 2, "%s\n", state);
+    return scnprintf(buf, PAGE_SIZE - 2, "%s\n", state);
  }

  static ssize_t control_store(struct device *dev, struct 
device_attribute *attr,
@@ -2917,7 +2917,7 @@ static DEVICE_ATTR_RW(control);
  static ssize_t active_show(struct device *dev,
                 struct device_attribute *attr, char *buf)
  {
-    return snprintf(buf, PAGE_SIZE - 2, "%d\n", sched_smt_active());
+    return scnprintf(buf, PAGE_SIZE - 2, "%d\n", sched_smt_active());
  }
  static DEVICE_ATTR_RO(active);

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <tencent_48D17833D10F2D6A2DF87986804C357D2506@qq.com>
2023-07-13  9:20 ` hanyu001 [this message]
2023-07-13 15:47   ` Greg KH

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=ef672732fbb865f338d88db89fc11062@208suo.com \
    --to=hanyu001@208suo.com \
    --cc=akpm@linux-foundation.org \
    --cc=dwmw@amazon.co.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npiggin@gmail.com \
    --cc=pauld@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=vdonnefort@google.com \
    --cc=vschneid@redhat.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®