Skip to content

Commit

Permalink
cpufreq: speedstep-lib: make several arrays static, makes code smaller
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Colin Ian King authored and Rafael J. Wysocki committed Aug 28, 2017
1 parent 9a6e91d commit 843791b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/cpufreq/speedstep-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static int relaxed_check;
static unsigned int pentium3_get_frequency(enum speedstep_processor processor)
{
/* See table 14 of p3_ds.pdf and table 22 of 29834003.pdf */
struct {
static const struct {
unsigned int ratio; /* Frequency Multiplier (x10) */
u8 bitmap; /* power on configuration bits
[27, 25:22] (in MSR 0x2a) */
Expand All @@ -58,7 +58,7 @@ static unsigned int pentium3_get_frequency(enum speedstep_processor processor)
};

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

0 comments on commit 843791b

Please sign in to comment.