Skip to contentSkip to conversation

scsi: hpsa: Use vsnprintf extension %phN

PATCH Applied Andy Shevchenko 2 participants 2 messages Dec 19, 2017 – Jan 8, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: hpsa: Use vsnprintf extension %phN

Using this extension reduces the object size.

---
 drivers/scsi/hpsa.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
drivers/scsi/hpsa.c +3 -11
index b0aa5dc1d54c..4c018b653f18 100644
@@ -4619,21 +4619,13 @@ static int hpsa_scatter_gather(struct ctlr_info *h,
 	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
Signature · 1 line
2.15.1
#1 lore raw

Andy,

Quoted 1 line

Using this extension reduces the object size.

Applied to 4.16/scsi-queue, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering