scsi: print single-character strings with seq_putc
Using seq_putc to print a single character saves at least a strlen()
call and a memory access, and may also give a small .text reduction.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Christoph Hellwig <hch@lst.de>
diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
index 581de8f..251598e 100644
--- a/drivers/scsi/scsi_proc.c
+++ b/drivers/scsi/scsi_proc.c
@@ -191,7 +191,7 @@
if (sdev->vendor[i] >= 0x20)
seq_putc(s, sdev->vendor[i]);
else
- seq_puts(s, " ");
+ seq_putc(s, ' ');
}
seq_puts(s, " Model: ");
@@ -199,7 +199,7 @@
if (sdev->model[i] >= 0x20)
seq_putc(s, sdev->model[i]);
else
- seq_puts(s, " ");
+ seq_putc(s, ' ');
}
seq_puts(s, " Rev: ");
@@ -207,10 +207,10 @@
if (sdev->rev[i] >= 0x20)
seq_putc(s, sdev->rev[i]);
else
- seq_puts(s, " ");
+ seq_putc(s, ' ');
}
- seq_puts(s, "\n");
+ seq_putc(s, '\n');
seq_printf(s, " Type: %s ", scsi_device_type(sdev->type));
seq_printf(s, " ANSI SCSI revision: %02x",
@@ -218,7 +218,7 @@
if (sdev->scsi_level == 2)
seq_puts(s, " CCS\n");
else
- seq_puts(s, "\n");
+ seq_putc(s, '\n');
out:
return 0;