scsi: hpsa: Use vsnprintf extension %phN
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 19 Dec 2017 17:09:59 +0000 (19:09 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 8 Jan 2018 15:53:39 +0000 (10:53 -0500)
Using this extension reduces the object size.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hpsa.c

index 3bb819109a390c9f751b5a971a5fd0fa2b551def..87b260e403ec66f451207d4ad458f4a8988108df 100644 (file)
@@ -4619,21 +4619,13 @@ sglist_finished:
        return 0;
 }
 
-#define BUFLEN 128
 static inline void warn_zero_length_transfer(struct ctlr_info *h,
                                                u8 *cdb, int cdb_len,
                                                const char *func)
 {
-       char buf[BUFLEN];
-       int outlen;
-       int i;
-
-       outlen = scnprintf(buf, BUFLEN,
-                               "%s: Blocking zero-length request: CDB:", func);
-       for (i = 0; i < cdb_len; i++)
-               outlen += scnprintf(buf+outlen, BUFLEN - outlen,
-                                       "%02hhx", cdb[i]);
-       dev_warn(&h->pdev->dev, "%s\n", buf);
+       dev_warn(&h->pdev->dev,
+                "%s: Blocking zero-length request: CDB:%*phN\n",
+                func, cdb_len, cdb);
 }
 
 #define IO_ACCEL_INELIGIBLE 1