Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/move_mount_set_group remove unneeded conversion to bool

The coccinelle report
./tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c:225:18-23:
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>

authored by

Yang Guang and committed by
Shuah Khan
009482c0 6d425d7c

+5 -5
+5 -5
tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c
··· 191 191 #define SET_GROUP_FROM "/tmp/move_mount_set_group_supported_from" 192 192 #define SET_GROUP_TO "/tmp/move_mount_set_group_supported_to" 193 193 194 - static int move_mount_set_group_supported(void) 194 + static bool move_mount_set_group_supported(void) 195 195 { 196 196 int ret; 197 197 ··· 222 222 AT_FDCWD, SET_GROUP_TO, MOVE_MOUNT_SET_GROUP); 223 223 umount2("/tmp", MNT_DETACH); 224 224 225 - return ret < 0 ? false : true; 225 + return ret >= 0; 226 226 } 227 227 228 228 FIXTURE(move_mount_set_group) { ··· 232 232 233 233 FIXTURE_SETUP(move_mount_set_group) 234 234 { 235 - int ret; 235 + bool ret; 236 236 237 237 ASSERT_EQ(prepare_unpriv_mountns(), 0); 238 238 ··· 254 254 255 255 FIXTURE_TEARDOWN(move_mount_set_group) 256 256 { 257 - int ret; 257 + bool ret; 258 258 259 259 ret = move_mount_set_group_supported(); 260 260 ASSERT_GE(ret, 0); ··· 348 348 .shared = false, 349 349 }; 350 350 pid_t pid; 351 - int ret; 351 + bool ret; 352 352 353 353 ret = move_mount_set_group_supported(); 354 354 ASSERT_GE(ret, 0);