Skip to content

Commit 5355ccb

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
x86/cpufeature: Reindent _static_cpu_has()
Because its daft.. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Borislav Petkov <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent 328008a commit 5355ccb

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

arch/x86/include/asm/cpufeature.h

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -148,45 +148,45 @@ extern void clear_cpu_cap(struct cpuinfo_x86 *c, unsigned int bit);
148148
*/
149149
static __always_inline __pure bool _static_cpu_has(u16 bit)
150150
{
151-
asm_volatile_goto("1: jmp 6f\n"
152-
"2:\n"
153-
".skip -(((5f-4f) - (2b-1b)) > 0) * "
154-
"((5f-4f) - (2b-1b)),0x90\n"
155-
"3:\n"
156-
".section .altinstructions,\"a\"\n"
157-
" .long 1b - .\n" /* src offset */
158-
" .long 4f - .\n" /* repl offset */
159-
" .word %P1\n" /* always replace */
160-
" .byte 3b - 1b\n" /* src len */
161-
" .byte 5f - 4f\n" /* repl len */
162-
" .byte 3b - 2b\n" /* pad len */
163-
".previous\n"
164-
".section .altinstr_replacement,\"ax\"\n"
165-
"4: jmp %l[t_no]\n"
166-
"5:\n"
167-
".previous\n"
168-
".section .altinstructions,\"a\"\n"
169-
" .long 1b - .\n" /* src offset */
170-
" .long 0\n" /* no replacement */
171-
" .word %P0\n" /* feature bit */
172-
" .byte 3b - 1b\n" /* src len */
173-
" .byte 0\n" /* repl len */
174-
" .byte 0\n" /* pad len */
175-
".previous\n"
176-
".section .altinstr_aux,\"ax\"\n"
177-
"6:\n"
178-
" testb %[bitnum],%[cap_byte]\n"
179-
" jnz %l[t_yes]\n"
180-
" jmp %l[t_no]\n"
181-
".previous\n"
182-
: : "i" (bit), "i" (X86_FEATURE_ALWAYS),
183-
[bitnum] "i" (1 << (bit & 7)),
184-
[cap_byte] "m" (((const char *)boot_cpu_data.x86_capability)[bit >> 3])
185-
: : t_yes, t_no);
186-
t_yes:
187-
return true;
188-
t_no:
189-
return false;
151+
asm_volatile_goto("1: jmp 6f\n"
152+
"2:\n"
153+
".skip -(((5f-4f) - (2b-1b)) > 0) * "
154+
"((5f-4f) - (2b-1b)),0x90\n"
155+
"3:\n"
156+
".section .altinstructions,\"a\"\n"
157+
" .long 1b - .\n" /* src offset */
158+
" .long 4f - .\n" /* repl offset */
159+
" .word %P1\n" /* always replace */
160+
" .byte 3b - 1b\n" /* src len */
161+
" .byte 5f - 4f\n" /* repl len */
162+
" .byte 3b - 2b\n" /* pad len */
163+
".previous\n"
164+
".section .altinstr_replacement,\"ax\"\n"
165+
"4: jmp %l[t_no]\n"
166+
"5:\n"
167+
".previous\n"
168+
".section .altinstructions,\"a\"\n"
169+
" .long 1b - .\n" /* src offset */
170+
" .long 0\n" /* no replacement */
171+
" .word %P0\n" /* feature bit */
172+
" .byte 3b - 1b\n" /* src len */
173+
" .byte 0\n" /* repl len */
174+
" .byte 0\n" /* pad len */
175+
".previous\n"
176+
".section .altinstr_aux,\"ax\"\n"
177+
"6:\n"
178+
" testb %[bitnum],%[cap_byte]\n"
179+
" jnz %l[t_yes]\n"
180+
" jmp %l[t_no]\n"
181+
".previous\n"
182+
: : "i" (bit), "i" (X86_FEATURE_ALWAYS),
183+
[bitnum] "i" (1 << (bit & 7)),
184+
[cap_byte] "m" (((const char *)boot_cpu_data.x86_capability)[bit >> 3])
185+
: : t_yes, t_no);
186+
t_yes:
187+
return true;
188+
t_no:
189+
return false;
190190
}
191191

192192
#define static_cpu_has(bit) \

0 commit comments

Comments
 (0)