summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/Kconfig
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2016-03-22 15:32:05 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2016-04-11 16:57:09 -0400
commite1f0bce3a0db95007fec756225801e50477f32fd (patch)
tree4bcc48e7ff93364ac1ca0c88404a459b9c9c7774 /drivers/scsi/Kconfig
parent9d99a2e33a02c3290cb53013150ee06a304588ae (diff)
scsi: reduce CONFIG_SCSI_CONSTANTS=y impact by 8k
On 64 bit, struct error_info has 6 bytes of padding, which amounts to over 4k of wasted space in the additional[] array. We could easily get rid of that by instead using separate arrays for the codes and the pointers. However, we can do even better than that and save an additional 6 bytes per entry: In the table, just store the sizeof() the corresponding string literal. The cumulative sum of these is then the appropriate offset into additional_text, which is built from the concatenation (with '\0's inbetween) of the strings. $ scripts/bloat-o-meter /tmp/vmlinux vmlinux add/remove: 0/0 grow/shrink: 1/1 up/down: 24/-8488 (-8464) function old new delta scsi_extd_sense_format 136 160 +24 additional 11312 2824 -8488 The Kconfig help text used to say that CONFIG_SCSI_CONSTANTS=y costs around 75 KB, but that was a little exaggerated. The actual number was closer to 44K, and 36K with this patch. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Reviewed-by: Hannes Reinecke <hare@suse.com> Tested-by: Douglas Gilbert <dgilbert@interlog.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/Kconfig')
-rw-r--r--drivers/scsi/Kconfig4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index e80768f8e579..47611bda633f 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -202,12 +202,12 @@ config SCSI_ENCLOSURE
202 certain enclosure conditions to be reported and is not required. 202 certain enclosure conditions to be reported and is not required.
203 203
204config SCSI_CONSTANTS 204config SCSI_CONSTANTS
205 bool "Verbose SCSI error reporting (kernel size +=75K)" 205 bool "Verbose SCSI error reporting (kernel size += 36K)"
206 depends on SCSI 206 depends on SCSI
207 help 207 help
208 The error messages regarding your SCSI hardware will be easier to 208 The error messages regarding your SCSI hardware will be easier to
209 understand if you say Y here; it will enlarge your kernel by about 209 understand if you say Y here; it will enlarge your kernel by about
210 75 KB. If in doubt, say Y. 210 36 KB. If in doubt, say Y.
211 211
212config SCSI_LOGGING 212config SCSI_LOGGING
213 bool "SCSI logging facility" 213 bool "SCSI logging facility"