Skip to content

Commit 843791b

Browse files
Colin Ian Kingrafaeljw
authored andcommitted
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 9a6e91d commit 843791b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/cpufreq/speedstep-lib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static int relaxed_check;
3535
static unsigned int pentium3_get_frequency(enum speedstep_processor processor)
3636
{
3737
/* See table 14 of p3_ds.pdf and table 22 of 29834003.pdf */
38-
struct {
38+
static const struct {
3939
unsigned int ratio; /* Frequency Multiplier (x10) */
4040
u8 bitmap; /* power on configuration bits
4141
[27, 25:22] (in MSR 0x2a) */
@@ -58,7 +58,7 @@ static unsigned int pentium3_get_frequency(enum speedstep_processor processor)
5858
};
5959

6060
/* PIII(-M) FSB settings: see table b1-b of 24547206.pdf */
61-
struct {
61+
static const struct {
6262
unsigned int value; /* Front Side Bus speed in MHz */
6363
u8 bitmap; /* power on configuration bits [18: 19]
6464
(in MSR 0x2a) */

0 commit comments

Comments
 (0)