mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Fwd: [PATCH] scsi: arcmsr: (ina2xx) Convert sysfs sprintf/snprintf family to sysfs_emit
       [not found] <tencent_3FF1E7BD0216D5C39552E3E9442AB41FB508@qq.com>
@ 2023-07-14  8:22 ` hanyu001
  0 siblings, 0 replies; only message in thread
From: hanyu001 @ 2023-07-14  8:22 UTC (permalink / raw)
  To: martin.petersen, jejb; +Cc: linux-scsi, linux-kernel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-14  8:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <tencent_3FF1E7BD0216D5C39552E3E9442AB41FB508@qq.com>
2023-07-14  8:22 ` Fwd: [PATCH] scsi: arcmsr: (ina2xx) Convert sysfs sprintf/snprintf family to sysfs_emit hanyu001

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome