selftests/mount: remove unneeded conversion to bool
authorYang Guang <yang.guang5@zte.com.cn>
Thu, 25 Nov 2021 00:56:03 +0000 (08:56 +0800)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 10 Dec 2021 23:46:01 +0000 (16:46 -0700)
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>
tools/testing/selftests/mount/unprivileged-remount-test.c

index 584dc6bc3b06679e8afd2a48ab52cd0e47e1ec56..d2917054fe3ae56d63225311a470dad3425f8fa0 100644 (file)
@@ -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);