diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-09-16 09:56:27 -0700 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-09-16 09:56:27 -0700 |
| commit | 0898782247ae533d1f4e47a06bc5d4870931b284 (patch) | |
| tree | 21f75cc590542a870f42350b9410fc0588f02b79 /lib/sbitmap.c | |
| parent | 0c043d70d04711fe6c380df9065fdc44192c49bf (diff) | |
| parent | 410f25de467ee94c1a577c6ee7370c37b376c17c (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 5.4 merge window.
Diffstat (limited to 'lib/sbitmap.c')
| -rw-r--r-- | lib/sbitmap.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/sbitmap.c b/lib/sbitmap.c index 54f57cd117c6..969e5400a615 100644 --- a/lib/sbitmap.c +++ b/lib/sbitmap.c @@ -26,9 +26,7 @@ static inline bool sbitmap_deferred_clear(struct sbitmap *sb, int index) /* * First get a stable cleared mask, setting the old mask to 0. */ - do { - mask = sb->map[index].cleared; - } while (cmpxchg(&sb->map[index].cleared, mask, 0) != mask); + mask = xchg(&sb->map[index].cleared, 0); /* * Now clear the masked bits in our free word @@ -516,10 +514,8 @@ static struct sbq_wait_state *sbq_wake_ptr(struct sbitmap_queue *sbq) struct sbq_wait_state *ws = &sbq->ws[wake_index]; if (waitqueue_active(&ws->wait)) { - int o = atomic_read(&sbq->wake_index); - - if (wake_index != o) - atomic_cmpxchg(&sbq->wake_index, o, wake_index); + if (wake_index != atomic_read(&sbq->wake_index)) + atomic_set(&sbq->wake_index, wake_index); return ws; } |
