From: Lennart Poettering Date: Wed, 20 Oct 2021 07:55:33 +0000 (+0200) Subject: loop-util: minor coding style updates X-Git-Tag: v250-rc1~466^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bfd084454dda2db6cc0690fafa94d4bc85a874aa;p=thirdparty%2Fsystemd.git loop-util: minor coding style updates As suggested here: https://github.com/systemd/systemd/pull/21044#pullrequestreview-783530343 --- diff --git a/src/shared/loop-util.c b/src/shared/loop-util.c index 072acc8c473..52c47e208e5 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); }