]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/x86/include/asm/percpu.h
x86, asm: use bool for bitops and other assembly outputs
[karo-tx-linux.git] / arch / x86 / include / asm / percpu.h
index e0ba66ca68c6fa6d4196204ac74cc9dc8bb00250..184d7f3ecb9f7de55444596f396e1bc0332d2bed 100644 (file)
@@ -510,14 +510,14 @@ do {                                                                      \
 /* This is not atomic against other CPUs -- CPU preemption needs to be off */
 #define x86_test_and_clear_bit_percpu(bit, var)                                \
 ({                                                                     \
-       int old__;                                                      \
-       asm volatile("btr %2,"__percpu_arg(1)"\n\tsbbl %0,%0"           \
-                    : "=r" (old__), "+m" (var)                         \
+       bool old__;                                                     \
+       asm volatile("btr %2,"__percpu_arg(1)"\n\tsetc %0"              \
+                    : "=qm" (old__), "+m" (var)                        \
                     : "dIr" (bit));                                    \
        old__;                                                          \
 })
 
-static __always_inline int x86_this_cpu_constant_test_bit(unsigned int nr,
+static __always_inline bool x86_this_cpu_constant_test_bit(unsigned int nr,
                         const unsigned long __percpu *addr)
 {
        unsigned long __percpu *a = (unsigned long *)addr + nr / BITS_PER_LONG;
@@ -529,14 +529,14 @@ static __always_inline int x86_this_cpu_constant_test_bit(unsigned int nr,
 #endif
 }
 
-static inline int x86_this_cpu_variable_test_bit(int nr,
+static inline bool x86_this_cpu_variable_test_bit(int nr,
                         const unsigned long __percpu *addr)
 {
-       int oldbit;
+       bool oldbit;
 
        asm volatile("bt "__percpu_arg(2)",%1\n\t"
-                       "sbb %0,%0"
-                       : "=r" (oldbit)
+                       "setc %0"
+                       : "=qm" (oldbit)
                        : "m" (*(unsigned long *)addr), "Ir" (nr));
 
        return oldbit;