Skip to contentSkip to conversation

tools:mount: Remove unnecessary conversion to bool

PATCH In review CGEL 2 participants 2 messages Aug 20, 2021 – Aug 24, 2021 Kselftest

lore
Share & tools
lore

CGEL

author
#0 lore raw

PATCH 1/1 tools:mount: Remove unnecessary conversion to bool

From: jing yangyang <[email protected]>

Suppress following warning from coccinelle:

./tools/testing/selftests/mount/unprivileged-remount-test.c:285:54-59: WARNING conversion to bool not needed here ./tools/testing/selftests/mount/unprivileged-remount-test.c:207:54-59: WARNING conversion to bool not needed here

---
 tools/testing/selftests/mount/unprivileged-remount-test.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/mount/unprivileged-remount-test.c +2 -2
index 584dc6b..bc802f6 100644
@@ -204,7 +204,7 @@ bool test_unpriv_remount(const char *fstype, const char *mount_options,
 		if (!WIFEXITED(status)) {
 			die("child did not terminate cleanly\n");
 		}
-		return WEXITSTATUS(status) == EXIT_SUCCESS ? true : false;
+		return WEXITSTATUS(status) == EXIT_SUCCESS;
 	}
 
 	create_and_enter_userns();
@@ -282,7 +282,7 @@ static bool test_priv_mount_unpriv_remount(void)
 		if (!WIFEXITED(status)) {
 			die("child did not terminate cleanly\n");
 		}
-		return WEXITSTATUS(status) == EXIT_SUCCESS ? true : false;
+		return WEXITSTATUS(status) == EXIT_SUCCESS;
 	}
 
 	orig_mnt_flags = read_mnt_flags(orig_path);
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 28 lines · CGEL

From: jing yangyang <[email protected]>

Suppress following warning from coccinelle:

./tools/testing/selftests/mount/unprivileged-remount-test.c:285:54-59: WARNING conversion to bool not needed here ./tools/testing/selftests/mount/unprivileged-remount-test.c:207:54-59: WARNING conversion to bool not needed here

---
  tools/testing/selftests/mount/unprivileged-remount-test.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/mount/unprivileged-remount-test.c +1 -1
index 584dc6b..bc802f6 100644
@@ -204,7 +204,7 @@ bool test_unpriv_remount(const char *fstype, const char *mount_options,
  		if (!WIFEXITED(status)) {
  			die("child did not terminate cleanly\n");
  		}
-		return WEXITSTATUS(status) == EXIT_SUCCESS ? true : false;
+		return WEXITSTATUS(status) == EXIT_SUCCESS;
  	}
 
  	create_and_enter_userns();

tools/testing/selftests/mount/unprivileged-remount-test.c static bool test_priv_mount_unpriv_remount(void) · line 288

Quoted 8 lines
tools/testing/selftests/mount/unprivileged-remount-test.c +1 -1
@@ -282,7 +282,7 @@ static bool test_priv_mount_unpriv_remount(void)
  		if (!WIFEXITED(status)) {
  			die("child did not terminate cleanly\n");
  		}
-		return WEXITSTATUS(status) == EXIT_SUCCESS ? true : false;
+		return WEXITSTATUS(status) == EXIT_SUCCESS;
  	}
 
  	orig_mnt_flags = read_mnt_flags(orig_path);

We can't accept this patch. The from and Signed-off-by don't match.

thanks,
-- Shuah