Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpufreq: speedstep-lib: make several arrays static, makes code smaller

Don't populate arrays on the stack, instead make them static.
Makes the object code smaller by over 860 bytes:

Before:
text data bss dec hex filename
10716 5196 0 15912 3e28 drivers/cpufreq/speedstep-lib.o

After:
text data bss dec hex filename
9690 5356 0 15046 3ac6 drivers/cpufreq/speedstep-lib.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Colin Ian King and committed by
Rafael J. Wysocki
843791bb 9a6e91d0

+2 -2
+2 -2
drivers/cpufreq/speedstep-lib.c
··· 35 35 static unsigned int pentium3_get_frequency(enum speedstep_processor processor) 36 36 { 37 37 /* See table 14 of p3_ds.pdf and table 22 of 29834003.pdf */ 38 - struct { 38 + static const struct { 39 39 unsigned int ratio; /* Frequency Multiplier (x10) */ 40 40 u8 bitmap; /* power on configuration bits 41 41 [27, 25:22] (in MSR 0x2a) */ ··· 58 58 }; 59 59 60 60 /* PIII(-M) FSB settings: see table b1-b of 24547206.pdf */ 61 - struct { 61 + static const struct { 62 62 unsigned int value; /* Front Side Bus speed in MHz */ 63 63 u8 bitmap; /* power on configuration bits [18: 19] 64 64 (in MSR 0x2a) */