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>] [day] [month] [year] [list]
Message-ID: <0969a39dca88032a93ce9c619e707d7d@208suo.com>
Date:   Thu, 13 Jul 2023 15:04:46 +0800
From:   hanyu001@...suo.com
To:     jejb@...ux.ibm.com, martin.petersen@...cle.com
Cc:     linux-scsi@...r.kernel.org, target-devel@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Fwd: [PATCH] scsi: ibmvscsi_tgt: Convert snprintf() to sysfs_emit()

Coccinnelle reports a warning
Warning: Use scnprintf or sprintf

WARNING: use scnprintf or sprintf
WARNING: use scnprintf or sprintf
WARNING: use scnprintf or sprintf
Signed-off-by: ztt <1549089851@...com>
---
  drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 
b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
index 385f812b8793..f9dad598380d 100644
--- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
+++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
@@ -3616,13 +3616,13 @@ static void ibmvscsis_remove(struct vio_dev 
*vdev)
  static ssize_t system_id_show(struct device *dev,
                    struct device_attribute *attr, char *buf)
  {
-    return snprintf(buf, PAGE_SIZE, "%s\n", system_id);
+    return scnprintf(buf, PAGE_SIZE, "%s\n", system_id);
  }

  static ssize_t partition_number_show(struct device *dev,
                       struct device_attribute *attr, char *buf)
  {
-    return snprintf(buf, PAGE_SIZE, "%x\n", partition_number);
+    return scnprintf(buf, PAGE_SIZE, "%x\n", partition_number);
  }

  static ssize_t unit_address_show(struct device *dev,
@@ -3630,7 +3630,7 @@ static ssize_t unit_address_show(struct device 
*dev,
  {
      struct scsi_info *vscsi = container_of(dev, struct scsi_info, dev);

-    return snprintf(buf, PAGE_SIZE, "%x\n", 
vscsi->dma_dev->unit_address);
+    return scnprintf(buf, PAGE_SIZE, "%x\n", 
vscsi->dma_dev->unit_address);
  }

  static int ibmvscsis_get_system_info(void)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ