[CRIU] [PATCH 5/7] files-reg: Remove redundant inner if

Rikard Falkeborn rikard.falkeborn at gmail.com
Sun Apr 28 21:22:53 MSK 2019


Remove a redundant if-statement, since the same condition is already
checked in the outer if-statement.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn at gmail.com>
---
 criu/files-reg.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/criu/files-reg.c b/criu/files-reg.c
index b30da8c9..b7e04384 100644
--- a/criu/files-reg.c
+++ b/criu/files-reg.c
@@ -1745,12 +1745,10 @@ ext:
 		}
 
 		if (rfi->rfe->has_mode && (st.st_mode != rfi->rfe->mode)) {
-			if (st.st_mode != rfi->rfe->mode) {
-				pr_err("File %s has bad mode 0%o (expect 0%o)\n",
-				       rfi->path, (int)st.st_mode,
-				       rfi->rfe->mode);
-				return -1;
-			}
+			pr_err("File %s has bad mode 0%o (expect 0%o)\n",
+			       rfi->path, (int)st.st_mode,
+			       rfi->rfe->mode);
+			return -1;
 		}
 
 		/*
-- 
2.21.0



More information about the CRIU mailing list