[2/3] crypto/ccp: use C11 memory model GCC builtin atomics
Checks
Commit Message
Replace use of __sync_fetch_and_or and __sync_fetch_and_and with
__atomic_fetch_or and __atomic_fetch_and.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
drivers/crypto/ccp/ccp_dev.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
@@ -116,13 +116,15 @@ struct ccp_queue *
static inline void
ccp_set_bit(unsigned long *bitmap, int n)
{
- __sync_fetch_and_or(&bitmap[WORD_OFFSET(n)], (1UL << BIT_OFFSET(n)));
+ __atomic_fetch_or(&bitmap[WORD_OFFSET(n)], (1UL << BIT_OFFSET(n)),
+ __ATOMIC_SEQ_CST);
}
static inline void
ccp_clear_bit(unsigned long *bitmap, int n)
{
- __sync_fetch_and_and(&bitmap[WORD_OFFSET(n)], ~(1UL << BIT_OFFSET(n)));
+ __atomic_fetch_and(&bitmap[WORD_OFFSET(n)], ~(1UL << BIT_OFFSET(n)),
+ __ATOMIC_SEQ_CST);
}
static inline uint32_t