mirror of
https://github.com/systemd/systemd.git
synced 2024-11-26 19:53:45 +08:00
simplify bitwise checking (#30722)
Some of these checks before bitwise operations are redundant and compilers do not always recognize them, so let's simplify the code to make the intentions clearer.
This commit is contained in:
parent
35716eed55
commit
5ba46b99f7
@ -626,8 +626,7 @@ static int append_tmpfs_mounts(MountList *ml, const TemporaryFileSystem *tmpfs,
|
||||
return log_debug_errno(r, "Failed to parse mount option '%s': %m", str);
|
||||
|
||||
ro = flags & MS_RDONLY;
|
||||
if (ro)
|
||||
flags ^= MS_RDONLY;
|
||||
flags &= ~MS_RDONLY;
|
||||
|
||||
MountEntry *me = mount_list_extend(ml);
|
||||
if (!me)
|
||||
|
@ -821,8 +821,8 @@ int mount_option_mangle(
|
||||
|
||||
if (!(ent->mask & MNT_INVERT))
|
||||
mount_flags |= ent->id;
|
||||
else if (mount_flags & ent->id)
|
||||
mount_flags ^= ent->id;
|
||||
else
|
||||
mount_flags &= ~ent->id;
|
||||
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user