Skip to content

Commit

Permalink
selftests/mount: remove unneeded conversion to bool
Browse files Browse the repository at this point in the history
The coccinelle report
./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
Relational and logical operators evaluate to bool,
explicit conversion is overly verbose and unneeded.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Yang Guang <yang.guang5@zte.com.cn>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
  • Loading branch information
Yang Guang authored and Shuah Khan committed Dec 10, 2021
1 parent 3abedf4 commit 6d425d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/mount/unprivileged-remount-test.c
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 6d425d7

Please sign in to comment.