soc/amd/common/block/cpu/tsc_freq: move static variable inside function
Move the static mhz variable inside the only function that is accessing it. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: Ief98c0a1c35fe1bbc4ff38dd175f12e0b3ddc515 Reviewed-on: https://review.coreboot.org/c/coreboot/+/74014 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
This commit is contained in:
parent
4057ab4f31
commit
56f1221f2f
|
@ -7,8 +7,6 @@
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <soc/msr.h>
|
#include <soc/msr.h>
|
||||||
|
|
||||||
static unsigned long mhz;
|
|
||||||
|
|
||||||
/* Use this default TSC frequency when it can not be correctly calculated.
|
/* Use this default TSC frequency when it can not be correctly calculated.
|
||||||
Higher numbers are safer as it will result in longer delays using TSC */
|
Higher numbers are safer as it will result in longer delays using TSC */
|
||||||
#define TSC_DEFAULT_FREQ_MHZ 4000
|
#define TSC_DEFAULT_FREQ_MHZ 4000
|
||||||
|
@ -17,6 +15,7 @@ unsigned long tsc_freq_mhz(void)
|
||||||
{
|
{
|
||||||
union pstate_msr pstate_reg;
|
union pstate_msr pstate_reg;
|
||||||
uint8_t high_state;
|
uint8_t high_state;
|
||||||
|
static unsigned long mhz;
|
||||||
|
|
||||||
if (mhz)
|
if (mhz)
|
||||||
return mhz;
|
return mhz;
|
||||||
|
|
Loading…
Reference in New Issue