summaryrefslogtreecommitdiffstats
path: root/src/basic/barrier.h
diff options
context:
space:
mode:
authorAndreas Rammhold <andreas@rammhold.de>2017-09-29 00:37:23 +0200
committerAndreas Rammhold <andreas@rammhold.de>2017-10-02 13:09:54 +0200
commit3742095b27f8df4b195d530b52d15bc5fea70bf1 (patch)
tree3fc7c3503845b733f1d58366436c0bb672d3613a /src/basic/barrier.h
parentman: move non-target units together (#6934) (diff)
downloadsystemd-3742095b27f8df4b195d530b52d15bc5fea70bf1.tar.xz
systemd-3742095b27f8df4b195d530b52d15bc5fea70bf1.zip
tree-wide: use IN_SET where possible
In addition to the changes from #6933 this handles cases that could be matched with the included cocci file.
Diffstat (limited to 'src/basic/barrier.h')
-rw-r--r--src/basic/barrier.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/basic/barrier.h b/src/basic/barrier.h
index 6347fddc4d..1e54c82425 100644
--- a/src/basic/barrier.h
+++ b/src/basic/barrier.h
@@ -70,11 +70,11 @@ bool barrier_sync_next(Barrier *b);
bool barrier_sync(Barrier *b);
static inline bool barrier_i_aborted(Barrier *b) {
- return b->barriers == BARRIER_I_ABORTED || b->barriers == BARRIER_WE_ABORTED;
+ return IN_SET(b->barriers, BARRIER_I_ABORTED, BARRIER_WE_ABORTED);
}
static inline bool barrier_they_aborted(Barrier *b) {
- return b->barriers == BARRIER_THEY_ABORTED || b->barriers == BARRIER_WE_ABORTED;
+ return IN_SET(b->barriers, BARRIER_THEY_ABORTED, BARRIER_WE_ABORTED);
}
static inline bool barrier_we_aborted(Barrier *b) {
@@ -82,7 +82,8 @@ static inline bool barrier_we_aborted(Barrier *b) {
}
static inline bool barrier_is_aborted(Barrier *b) {
- return b->barriers == BARRIER_I_ABORTED || b->barriers == BARRIER_THEY_ABORTED || b->barriers == BARRIER_WE_ABORTED;
+ return IN_SET(b->barriers, BARRIER_I_ABORTED, BARRIER_THEY_ABORTED,
+ BARRIER_WE_ABORTED);
}
static inline bool barrier_place_and_sync(Barrier *b) {