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: <a70b030b0e0bdf224d35dec9aecc7371@208suo.com>
Date:   Fri, 14 Jul 2023 16:10:43 +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: be2iscsi: wacom: convert sysfs sprintf/snprintf
 family to sysfs_emit

Fix the following coccicheck warning:

./drivers/hid/wacom_sys.c:1828:8-16: WARNING: use scnprintf or sprintf.

./drivers/scsi/be2iscsi/be_mgmt.c:1251:9-17: WARNING: use scnprintf or 
sprintf
./drivers/scsi/be2iscsi/be_mgmt.c:1145:8-16: WARNING: use scnprintf or 
sprintf
./drivers/scsi/be2iscsi/be_mgmt.c:1164:8-16: WARNING: use scnprintf or 
sprintf
./drivers/scsi/be2iscsi/be_mgmt.c:1280:8-16: WARNING: use scnprintf or 
sprintf

Signed-off-by: ztt <1549089851@...com>
---
  drivers/scsi/be2iscsi/be_mgmt.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_mgmt.c 
b/drivers/scsi/be2iscsi/be_mgmt.c
index 4e899ec1477d..4916ce9c36a6 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -1142,7 +1142,7 @@ ssize_t
  beiscsi_drvr_ver_disp(struct device *dev, struct device_attribute 
*attr,
                 char *buf)
  {
-    return snprintf(buf, PAGE_SIZE, BE_NAME "\n");
+    return scnprintf(buf, PAGE_SIZE, BE_NAME "\n");
  }

  /**
@@ -1161,7 +1161,7 @@ beiscsi_fw_ver_disp(struct device *dev, struct 
device_attribute *attr,
      struct Scsi_Host *shost = class_to_shost(dev);
      struct beiscsi_hba *phba = iscsi_host_priv(shost);

-    return snprintf(buf, PAGE_SIZE, "%s\n", phba->fw_ver_str);
+    return scnprintf(buf, PAGE_SIZE, "%s\n", phba->fw_ver_str);
  }

  /**
@@ -1248,7 +1248,7 @@ beiscsi_adap_family_disp(struct device *dev, 
struct device_attribute *attr,
      case BE_DEVICE_ID1:
      case OC_DEVICE_ID1:
      case OC_DEVICE_ID2:
-        return snprintf(buf, PAGE_SIZE,
+        return scnprintf(buf, PAGE_SIZE,
                  "Obsolete/Unsupported BE2 Adapter Family\n");
      case BE_DEVICE_ID2:
      case OC_DEVICE_ID3:
@@ -1277,7 +1277,7 @@ beiscsi_phys_port_disp(struct device *dev, struct 
device_attribute *attr,
      struct Scsi_Host *shost = class_to_shost(dev);
      struct beiscsi_hba *phba = iscsi_host_priv(shost);

-    return snprintf(buf, PAGE_SIZE, "Port Identifier : %u\n",
+    return scnprintf(buf, PAGE_SIZE, "Port Identifier : %u\n",
              phba->fw_config.phys_port);
  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ