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:
Jan Beulich authored and Andrew Cooper committed 2026-09-02 21:44:30 +01:00
1 parent cfad3bc123
commit d5d126a225
1 file changed
+9 -3
+9 -3
View File
@@ -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;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.