mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86/bitops: don't cast away volatile-ness
Doing so, besides being a bad idea in general, violates Misra rule 11.8.
No functional change intended.
Fixes: f1879b2c25 ("xen: introduce generic non-atomic test_*bit()")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
This commit is contained in:
1 parent
cfad3bc123
commit
d5d126a225
1 file changed
+9
-3
@@ -191,7 +191,9 @@ static inline int arch__test_and_set_bit(int nr, volatile void *addr)
|
||||
asm volatile ( "btsl %[nr], %[addr]\n\t"
|
||||
ASM_FLAG_OUT(, "sbbl %[old], %[old]\n\t")
|
||||
: [old] ASM_FLAG_OUT("=@ccc", "=r") (oldbit),
|
||||
[addr] "+m" (*(int *)addr) : [nr] "Ir" (nr) : "memory" );
|
||||
[addr] "+m" (*(volatile int *)addr)
|
||||
: [nr] "Ir" (nr)
|
||||
: "memory" );
|
||||
|
||||
return oldbit;
|
||||
}
|
||||
@@ -239,7 +241,9 @@ static inline int arch__test_and_clear_bit(int nr, volatile void *addr)
|
||||
asm volatile ( "btrl %[nr], %[addr]\n\t"
|
||||
ASM_FLAG_OUT(, "sbbl %[old], %[old]\n\t")
|
||||
: [old] ASM_FLAG_OUT("=@ccc", "=r") (oldbit),
|
||||
[addr] "+m" (*(int *)addr) : [nr] "Ir" (nr) : "memory" );
|
||||
[addr] "+m" (*(volatile int *)addr)
|
||||
: [nr] "Ir" (nr)
|
||||
: "memory" );
|
||||
|
||||
return oldbit;
|
||||
}
|
||||
@@ -253,7 +257,9 @@ static inline int arch__test_and_change_bit(int nr, volatile void *addr)
|
||||
asm volatile ( "btcl %[nr], %[addr]\n\t"
|
||||
ASM_FLAG_OUT(, "sbbl %[old], %[old]\n\t")
|
||||
: [old] ASM_FLAG_OUT("=@ccc", "=r") (oldbit),
|
||||
[addr] "+m" (*(int *)addr) : [nr] "Ir" (nr) : "memory" );
|
||||
[addr] "+m" (*(volatile int *)addr)
|
||||
: [nr] "Ir" (nr)
|
||||
: "memory" );
|
||||
|
||||
return oldbit;
|
||||
}
|
||||
|
||||