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: <feb3f5bb92896daf589f7d3a4c839dec@208suo.com>
Date:   Fri, 14 Jul 2023 16:22:39 +0800
From:   hanyu001@...suo.com
To:     martin.petersen@...cle.com, jejb@...ux.ibm.com
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Fwd: [PATCH] scsi: arcmsr: (ina2xx) Convert sysfs sprintf/snprintf
 family to sysfs_emit

Fix the following coccicheck warning:

drivers/hwmon/ina2xx.c:313:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/ina2xx.c:453:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/ina2xx.c:484:8-16: WARNING: use scnprintf or sprintf
drivers/hwmon/ina2xx.c:540:8-16: WARNING: use scnprintf or sprintf

./drivers/scsi/arcmsr/arcmsr_attr.c:297:8-16: WARNING: use scnprintf or 
sprintf
./drivers/scsi/arcmsr/arcmsr_attr.c:273:8-16: WARNING: use scnprintf or 
sprintf
./drivers/scsi/arcmsr/arcmsr_attr.c:285:8-16: WARNING: use scnprintf or 
sprintf
./drivers/scsi/arcmsr/arcmsr_attr.c:261:8-16: WARNING: use scnprintf or 
sprintf
./drivers/scsi/arcmsr/arcmsr_attr.c:374:8-16: WARNING: use scnprintf or 
sprintf
./drivers/scsi/arcmsr/arcmsr_attr.c:309:8-16: WARNING: use scnprintf or 
sprintf
./drivers/scsi/arcmsr/arcmsr_attr.c:348:8-16: WARNING: use scnprintf or 
sprintf
./drivers/scsi/arcmsr/arcmsr_attr.c:335:8-16: WARNING: use scnprintf or 
sprintf
./drivers/scsi/arcmsr/arcmsr_attr.c:361:8-16: WARNING: use scnprintf or 
sprintf
./drivers/scsi/arcmsr/arcmsr_attr.c:322:8-16: WARNING: use scnprintf or 
sprintf

Signed-off-by: ztt <1549089851@...com>
---
  drivers/scsi/arcmsr/arcmsr_attr.c | 20 ++++++++++----------
  1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/arcmsr/arcmsr_attr.c 
b/drivers/scsi/arcmsr/arcmsr_attr.c
index baeb5e795690..94bc7c783024 100644
--- a/drivers/scsi/arcmsr/arcmsr_attr.c
+++ b/drivers/scsi/arcmsr/arcmsr_attr.c
@@ -258,7 +258,7 @@ static ssize_t
  arcmsr_attr_host_driver_version(struct device *dev,
                  struct device_attribute *attr, char *buf)
  {
-    return snprintf(buf, PAGE_SIZE,
+    return scnprintf(buf, PAGE_SIZE,
              "%s\n",
              ARCMSR_DRIVER_VERSION);
  }
@@ -270,7 +270,7 @@ arcmsr_attr_host_driver_posted_cmd(struct device 
*dev,
      struct Scsi_Host *host = class_to_shost(dev);
      struct AdapterControlBlock *acb =
          (struct AdapterControlBlock *) host->hostdata;
-    return snprintf(buf, PAGE_SIZE,
+    return scnprintf(buf, PAGE_SIZE,
              "%4d\n",
              atomic_read(&acb->ccboutstandingcount));
  }
@@ -282,7 +282,7 @@ arcmsr_attr_host_driver_reset(struct device *dev,
      struct Scsi_Host *host = class_to_shost(dev);
      struct AdapterControlBlock *acb =
          (struct AdapterControlBlock *) host->hostdata;
-    return snprintf(buf, PAGE_SIZE,
+    return scnprintf(buf, PAGE_SIZE,
              "%4d\n",
              acb->num_resets);
  }
@@ -294,7 +294,7 @@ arcmsr_attr_host_driver_abort(struct device *dev,
      struct Scsi_Host *host = class_to_shost(dev);
      struct AdapterControlBlock *acb =
          (struct AdapterControlBlock *) host->hostdata;
-    return snprintf(buf, PAGE_SIZE,
+    return scnprintf(buf, PAGE_SIZE,
              "%4d\n",
              acb->num_aborts);
  }
@@ -306,7 +306,7 @@ arcmsr_attr_host_fw_model(struct device *dev, struct 
device_attribute *attr,
      struct Scsi_Host *host = class_to_shost(dev);
      struct AdapterControlBlock *acb =
          (struct AdapterControlBlock *) host->hostdata;
-    return snprintf(buf, PAGE_SIZE,
+    return scnprintf(buf, PAGE_SIZE,
              "%s\n",
              acb->firm_model);
  }
@@ -319,7 +319,7 @@ arcmsr_attr_host_fw_version(struct device *dev,
      struct AdapterControlBlock *acb =
              (struct AdapterControlBlock *) host->hostdata;

-    return snprintf(buf, PAGE_SIZE,
+    return scnprintf(buf, PAGE_SIZE,
              "%s\n",
              acb->firm_version);
  }
@@ -332,7 +332,7 @@ arcmsr_attr_host_fw_request_len(struct device *dev,
      struct AdapterControlBlock *acb =
          (struct AdapterControlBlock *) host->hostdata;

-    return snprintf(buf, PAGE_SIZE,
+    return scnprintf(buf, PAGE_SIZE,
              "%4d\n",
              acb->firm_request_len);
  }
@@ -345,7 +345,7 @@ arcmsr_attr_host_fw_numbers_queue(struct device 
*dev,
      struct AdapterControlBlock *acb =
          (struct AdapterControlBlock *) host->hostdata;

-    return snprintf(buf, PAGE_SIZE,
+    return scnprintf(buf, PAGE_SIZE,
              "%4d\n",
              acb->firm_numbers_queue);
  }
@@ -358,7 +358,7 @@ arcmsr_attr_host_fw_sdram_size(struct device *dev,
      struct AdapterControlBlock *acb =
          (struct AdapterControlBlock *) host->hostdata;

-    return snprintf(buf, PAGE_SIZE,
+    return scnprintf(buf, PAGE_SIZE,
              "%4d\n",
              acb->firm_sdram_size);
  }
@@ -371,7 +371,7 @@ arcmsr_attr_host_fw_hd_channels(struct device *dev,
      struct AdapterControlBlock *acb =
          (struct AdapterControlBlock *) host->hostdata;

-    return snprintf(buf, PAGE_SIZE,
+    return scnprintf(buf, PAGE_SIZE,
              "%4d\n",
              acb->firm_hd_channels);
  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ