lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <ef672732fbb865f338d88db89fc11062@208suo.com>
Date:   Thu, 13 Jul 2023 17:20:49 +0800
From:   hanyu001@...suo.com
To:     tglx@...utronix.de, peterz@...radead.org, vschneid@...hat.com,
        dwmw@...zon.co.uk, akpm@...ux-foundation.org, npiggin@...il.com,
        pauld@...hat.com, vdonnefort@...gle.com, gregkh@...uxfoundation.org
Cc:     linux-kernel@...r.kernel.org
Subject: Fwd: [PATCH] kernel:  convert sysfs snprintf to sysfs_emit

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@...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);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ