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: <0130702c160ac0e88f3fd3e2ef02dfbc@208suo.com>
Date:   Mon, 17 Jul 2023 10:32:59 +0800
From:   hanyu001@...suo.com
To:     jejb@...ux.ibm.com, martin.petersen@...cle.com
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Fwd: [PATCH] scsi: Convert snprintf to scnprintf

Fix the coccicheck warnings:

./drivers/scsi/scsi_transport_sas.c:525:9-17: WARNING: use scnprintf or 
sprintf
./drivers/scsi/scsi_transport_sas.c:572:8-16: WARNING: use scnprintf or 
sprintf
./drivers/scsi/scsi_transport_sas.c:1180:9-17: WARNING: use scnprintf or 
sprintf

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

diff --git a/drivers/scsi/scsi_transport_sas.c 
b/drivers/scsi/scsi_transport_sas.c
index d704c484a251..bbbe6ff28b34 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -522,7 +522,7 @@ show_sas_device_type(struct device *dev,
      struct sas_phy *phy = transport_class_to_phy(dev);

      if (!phy->identify.device_type)
-        return snprintf(buf, 20, "none\n");
+        return scnprintf(buf, 20, "none\n");
      return get_sas_device_type_names(phy->identify.device_type, buf);
  }
  static DEVICE_ATTR(device_type, S_IRUGO, show_sas_device_type, NULL);
@@ -569,7 +569,7 @@ show_sas_phy_enable(struct device *dev, struct 
device_attribute *attr,
  {
      struct sas_phy *phy = transport_class_to_phy(dev);

-    return snprintf(buf, 20, "%d\n", phy->enabled);
+    return scnprintf(buf, 20, "%d\n", phy->enabled);
  }

  static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, show_sas_phy_enable,
@@ -1177,7 +1177,7 @@ show_sas_rphy_device_type(struct device *dev,
      struct sas_rphy *rphy = transport_class_to_rphy(dev);

      if (!rphy->identify.device_type)
-        return snprintf(buf, 20, "none\n");
+        return scnprintf(buf, 20, "none\n");
      return get_sas_device_type_names(
              rphy->identify.device_type, buf);
  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ