Skip to content

Commit 3197b04

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
x86/cpufeature: Update _static_cpu_has() to use all named variables
Because more readable.. Requested-by: Josh Poimboeuf <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[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 5355ccb commit 3197b04

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

arch/x86/include/asm/cpufeature.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static __always_inline __pure bool _static_cpu_has(u16 bit)
156156
".section .altinstructions,\"a\"\n"
157157
" .long 1b - .\n" /* src offset */
158158
" .long 4f - .\n" /* repl offset */
159-
" .word %P1\n" /* always replace */
159+
" .word %P[always]\n" /* always replace */
160160
" .byte 3b - 1b\n" /* src len */
161161
" .byte 5f - 4f\n" /* repl len */
162162
" .byte 3b - 2b\n" /* pad len */
@@ -168,7 +168,7 @@ static __always_inline __pure bool _static_cpu_has(u16 bit)
168168
".section .altinstructions,\"a\"\n"
169169
" .long 1b - .\n" /* src offset */
170170
" .long 0\n" /* no replacement */
171-
" .word %P0\n" /* feature bit */
171+
" .word %P[feature]\n" /* feature bit */
172172
" .byte 3b - 1b\n" /* src len */
173173
" .byte 0\n" /* repl len */
174174
" .byte 0\n" /* pad len */
@@ -179,8 +179,9 @@ static __always_inline __pure bool _static_cpu_has(u16 bit)
179179
" jnz %l[t_yes]\n"
180180
" jmp %l[t_no]\n"
181181
".previous\n"
182-
: : "i" (bit), "i" (X86_FEATURE_ALWAYS),
183-
[bitnum] "i" (1 << (bit & 7)),
182+
: : [feature] "i" (bit),
183+
[always] "i" (X86_FEATURE_ALWAYS),
184+
[bitnum] "i" (1 << (bit & 7)),
184185
[cap_byte] "m" (((const char *)boot_cpu_data.x86_capability)[bit >> 3])
185186
: : t_yes, t_no);
186187
t_yes:

0 commit comments

Comments
 (0)