]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/condition: use BIT_SET where appropriate
authorMike Yuan <me@yhndnzj.com>
Thu, 26 Dec 2024 18:53:23 +0000 (19:53 +0100)
committerMike Yuan <me@yhndnzj.com>
Sat, 28 Dec 2024 14:08:00 +0000 (15:08 +0100)
src/shared/condition.c

index e4aa50c8f7fa897c85f43cbfd1ce9595ad283d15..390f9537bbf41f0cad3cea729e2bcca9563423d3 100644 (file)
@@ -19,6 +19,7 @@
 #include "architecture.h"
 #include "audit-util.h"
 #include "battery-util.h"
+#include "bitfield.h"
 #include "blockdev-util.h"
 #include "cap-list.h"
 #include "capability-util.h"
@@ -718,7 +719,7 @@ static int condition_test_capability(Condition *c, char **env) {
         if (r < 0)
                 return r;
 
-        return !!(q.bounding & ((UINT64_C(1) << value)));
+        return BIT_SET(q.bounding, value);
 }
 
 static int condition_test_needs_update(Condition *c, char **env) {