Skip to content

Commit 6e6a493

Browse files
author
H. Peter Anvin
committed
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>
1 parent 6145cfe commit 6e6a493

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎arch/x86/boot/compressed/cpuflags.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
bool has_cpuflag(int flag)
66
{
7-
get_flags();
7+
get_cpuflags();
88

99
return test_bit(flag, cpu.flags);
1010
}

‎arch/x86/boot/cpucheck.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static int is_transmeta(void)
6868
}
6969

7070
/* Returns a bitmask of which words we have error bits in */
71-
static int check_flags(void)
71+
static int check_cpuflags(void)
7272
{
7373
u32 err;
7474
int i;
@@ -101,8 +101,8 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr)
101101
if (has_eflag(X86_EFLAGS_AC))
102102
cpu.level = 4;
103103

104-
get_flags();
105-
err = check_flags();
104+
get_cpuflags();
105+
err = check_cpuflags();
106106

107107
if (test_bit(X86_FEATURE_LM, cpu.flags))
108108
cpu.level = 64;
@@ -121,8 +121,8 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr)
121121
eax &= ~(1 << 15);
122122
asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx));
123123

124-
get_flags(); /* Make sure it really did something */
125-
err = check_flags();
124+
get_cpuflags(); /* Make sure it really did something */
125+
err = check_cpuflags();
126126
} else if (err == 0x01 &&
127127
!(err_flags[0] & ~(1 << X86_FEATURE_CX8)) &&
128128
is_centaur() && cpu.model >= 6) {
@@ -137,7 +137,7 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr)
137137
asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx));
138138

139139
set_bit(X86_FEATURE_CX8, cpu.flags);
140-
err = check_flags();
140+
err = check_cpuflags();
141141
} else if (err == 0x01 && is_transmeta()) {
142142
/* Transmeta might have masked feature bits in word 0 */
143143

@@ -152,7 +152,7 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr)
152152
: : "ecx", "ebx");
153153
asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx));
154154

155-
err = check_flags();
155+
err = check_cpuflags();
156156
}
157157

158158
if (err_flags_ptr)

‎arch/x86/boot/cpuflags.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static inline void cpuid(u32 id, u32 *a, u32 *b, u32 *c, u32 *d)
6565
);
6666
}
6767

68-
void get_flags(void)
68+
void get_cpuflags(void)
6969
{
7070
u32 max_intel_level, max_amd_level;
7171
u32 tfms;

‎arch/x86/boot/cpuflags.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ extern struct cpu_features cpu;
1414
extern u32 cpu_vendor[3];
1515

1616
int has_eflag(unsigned long mask);
17-
void get_flags(void);
17+
void get_cpuflags(void);
1818

1919
#endif

0 commit comments

Comments
 (0)