Skip to contentSkip to conversation

scsi: ips: make array 'options' static const, makes object smaller

PATCH Applied Colin King 2 participants 2 messages Sep 6, 2019 – Oct 1, 2019

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 scsi: ips: make array 'options' static const, makes object smaller

From: Colin Ian King <[email protected]>

Don't populate the array 'options' on the stack but instead make it static const. Makes the object code smaller by 143 bytes.

Before:
text data bss dec hex filename
94483 11272 1184 106939 1a1bb drivers/scsi/ips.o

After:
text data bss dec hex filename
94244 11368 1184 106796 1a12c drivers/scsi/ips.o

(gcc version 9.2.1, amd64)

---
 drivers/scsi/ips.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ips.c +1 -1
index e8bc8d328bab..f25672982c5f 100644
@@ -498,7 +498,7 @@ ips_setup(char *ips_str)
 	int i;
 	char *key;
 	char *value;
-	IPS_OPTION options[] = {
+	static const IPS_OPTION options[] = {
 		{"noi2o", &ips_force_i2o, 0},
 		{"nommap", &ips_force_memio, 0},
 		{"ioctlsize", &ips_ioctlsize, IPS_IOCTL_SIZE},
Signature · 1 line
2.20.1
#1 lore raw

Colin,

Quoted 2 lines

Don't populate the array 'options' on the stack but instead make it static const. Makes the object code smaller by 143 bytes.

Applied to 5.5/scsi-queue, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering