aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2013-10-13 07:08:56 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2013-10-13 07:08:56 -0400
commit6e6a4932b0f569b1a5bb4fcbf5dde1b1a42f01bb (patch)
tree54a07dd9d29272246cef06edf26b9104dbfd7ada
parent6145cfe394a7f138f6b64491c5663f97dba12450 (diff)
x86, boot: Rename get_flags() and check_flags() to *_cpuflags()
When a function is used in more than one file it may not be possible to immediately tell from context what the intended meaning is. As such, it is more important that the naming be self-evident. Thus, change get_flags() to get_cpuflags(). For consistency, change check_flags() to check_cpuflags() even though it is only used in cpucheck.c. Link: http://lkml.kernel.org/r/1381450698-28710-2-git-send-email-keescook@chromium.org Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--arch/x86/boot/compressed/cpuflags.c2
-rw-r--r--arch/x86/boot/cpucheck.c14
-rw-r--r--arch/x86/boot/cpuflags.c2
-rw-r--r--arch/x86/boot/cpuflags.h2
4 files changed, 10 insertions, 10 deletions
diff --git a/arch/x86/boot/compressed/cpuflags.c b/arch/x86/boot/compressed/cpuflags.c
index 931cba6a4bb0..aa313466118b 100644
--- a/arch/x86/boot/compressed/cpuflags.c
+++ b/arch/x86/boot/compressed/cpuflags.c
@@ -4,7 +4,7 @@
4 4
5bool has_cpuflag(int flag) 5bool has_cpuflag(int flag)
6{ 6{
7 get_flags(); 7 get_cpuflags();
8 8
9 return test_bit(flag, cpu.flags); 9 return test_bit(flag, cpu.flags);
10} 10}
diff --git a/arch/x86/boot/cpucheck.c b/arch/x86/boot/cpucheck.c
index e1f3c166a512..100a9a10076a 100644
--- a/arch/x86/boot/cpucheck.c
+++ b/arch/x86/boot/cpucheck.c
@@ -68,7 +68,7 @@ static int is_transmeta(void)
68} 68}
69 69
70/* Returns a bitmask of which words we have error bits in */ 70/* Returns a bitmask of which words we have error bits in */
71static int check_flags(void) 71static int check_cpuflags(void)
72{ 72{
73 u32 err; 73 u32 err;
74 int i; 74 int i;
@@ -101,8 +101,8 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr)
101 if (has_eflag(X86_EFLAGS_AC)) 101 if (has_eflag(X86_EFLAGS_AC))
102 cpu.level = 4; 102 cpu.level = 4;
103 103
104 get_flags(); 104 get_cpuflags();
105 err = check_flags(); 105 err = check_cpuflags();
106 106
107 if (test_bit(X86_FEATURE_LM, cpu.flags)) 107 if (test_bit(X86_FEATURE_LM, cpu.flags))
108 cpu.level = 64; 108 cpu.level = 64;
@@ -121,8 +121,8 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr)
121 eax &= ~(1 << 15); 121 eax &= ~(1 << 15);
122 asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx)); 122 asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx));
123 123
124 get_flags(); /* Make sure it really did something */ 124 get_cpuflags(); /* Make sure it really did something */
125 err = check_flags(); 125 err = check_cpuflags();
126 } else if (err == 0x01 && 126 } else if (err == 0x01 &&
127 !(err_flags[0] & ~(1 << X86_FEATURE_CX8)) && 127 !(err_flags[0] & ~(1 << X86_FEATURE_CX8)) &&
128 is_centaur() && cpu.model >= 6) { 128 is_centaur() && cpu.model >= 6) {
@@ -137,7 +137,7 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr)
137 asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx)); 137 asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx));
138 138
139 set_bit(X86_FEATURE_CX8, cpu.flags); 139 set_bit(X86_FEATURE_CX8, cpu.flags);
140 err = check_flags(); 140 err = check_cpuflags();
141 } else if (err == 0x01 && is_transmeta()) { 141 } else if (err == 0x01 && is_transmeta()) {
142 /* Transmeta might have masked feature bits in word 0 */ 142 /* Transmeta might have masked feature bits in word 0 */
143 143
@@ -152,7 +152,7 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr)
152 : : "ecx", "ebx"); 152 : : "ecx", "ebx");
153 asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx)); 153 asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx));
154 154
155 err = check_flags(); 155 err = check_cpuflags();
156 } 156 }
157 157
158 if (err_flags_ptr) 158 if (err_flags_ptr)
diff --git a/arch/x86/boot/cpuflags.c b/arch/x86/boot/cpuflags.c
index b02544a2bce0..a9fcb7cfb241 100644
--- a/arch/x86/boot/cpuflags.c
+++ b/arch/x86/boot/cpuflags.c
@@ -65,7 +65,7 @@ static inline void cpuid(u32 id, u32 *a, u32 *b, u32 *c, u32 *d)
65 ); 65 );
66} 66}
67 67
68void get_flags(void) 68void get_cpuflags(void)
69{ 69{
70 u32 max_intel_level, max_amd_level; 70 u32 max_intel_level, max_amd_level;
71 u32 tfms; 71 u32 tfms;
diff --git a/arch/x86/boot/cpuflags.h b/arch/x86/boot/cpuflags.h
index 9bb4e25f7317..ea97697e51e4 100644
--- a/arch/x86/boot/cpuflags.h
+++ b/arch/x86/boot/cpuflags.h
@@ -14,6 +14,6 @@ extern struct cpu_features cpu;
14extern u32 cpu_vendor[3]; 14extern u32 cpu_vendor[3];
15 15
16int has_eflag(unsigned long mask); 16int has_eflag(unsigned long mask);
17void get_flags(void); 17void get_cpuflags(void);
18 18
19#endif 19#endif