[1/5] mount: Simplify ext_mount_parse_auto

Submitted by Radostin Stoyanov on Aug. 22, 2018, 7:54 p.m.

Details

Message ID 20180822195433.2770-2-rstoyanov1@gmail.com
State Accepted
Series "Tweaks"
Headers show

Commit Message

Radostin Stoyanov Aug. 22, 2018, 7:54 p.m.
There are no functional changes.

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
---
 criu/mount.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/mount.c b/criu/mount.c
index 62e012ec..078654f6 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -77,17 +77,13 @@  int ext_mount_parse_auto(char *key)
 	opts.autodetect_ext_mounts = true;
 
 	if (*key == ':') {
-		while (1) {
-			key++;
-			if (*key == '\0')
-				break;
-			else if (*key == 'm')
-				opts.enable_external_masters = true;
-			else if (*key == 's')
-				opts.enable_external_sharing = true;
-			else
-				return -1;
-		}
+		key++;
+		if (*key == 'm')
+			opts.enable_external_masters = true;
+		else if (*key == 's')
+			opts.enable_external_sharing = true;
+		else if (*key != '\0')
+			return -1;
 	}
 
 	return 0;