diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-10-20 09:55:33 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-10-20 09:55:33 +0200 |
commit | bfd084454dda2db6cc0690fafa94d4bc85a874aa (patch) | |
tree | 65ea4db46a6aa70da1533e9b7847e7d2e9bdee13 /src/shared/loop-util.c | |
parent | 231c7645ca761f0347c98fa48c68b3fde00fbc15 (diff) | |
download | systemd-bfd084454dda2db6cc0690fafa94d4bc85a874aa.tar.gz |
loop-util: minor coding style updates
As suggested here: https://github.com/systemd/systemd/pull/21044#pullrequestreview-783530343
Diffstat (limited to 'src/shared/loop-util.c')
-rw-r--r-- | src/shared/loop-util.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/shared/loop-util.c b/src/shared/loop-util.c index 072acc8c47..52c47e208e 100644 --- a/src/shared/loop-util.c +++ b/src/shared/loop-util.c @@ -615,8 +615,7 @@ static uint32_t loop_flags_mangle(uint32_t loop_flags) { if (r < 0 && r != -ENXIO) log_debug_errno(r, "Failed to parse $SYSTEMD_LOOP_DIRECT_IO, ignoring: %m"); - SET_FLAG(loop_flags, LO_FLAGS_DIRECT_IO, r != 0); /* Turn on LO_FLAGS_DIRECT_IO by default, unless explicitly configured to off. */ - return loop_flags; + return UPDATE_FLAG(loop_flags, LO_FLAGS_DIRECT_IO, r != 0); /* Turn on LO_FLAGS_DIRECT_IO by default, unless explicitly configured to off. */ } int loop_device_make( @@ -629,16 +628,13 @@ int loop_device_make( assert(fd >= 0); assert(ret); - assert(IN_SET(open_flags, O_RDWR, O_RDONLY)); - - loop_flags = loop_flags_mangle(loop_flags); return loop_device_make_internal( fd, open_flags, offset, size, - loop_flags, + loop_flags_mangle(loop_flags), ret); } |