lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bc39340a-8daf-fbe2-1450-2f074608c08b@linuxfoundation.org>
Date:   Fri, 3 Dec 2021 11:34:57 -0700
From:   Shuah Khan <skhan@...uxfoundation.org>
To:     davidcomponentone@...il.com, shuah@...nel.org
Cc:     christian.brauner@...ntu.com, ptikhomirov@...tuozzo.com,
        linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
        Yang Guang <yang.guang5@....com.cn>,
        Zeal Robot <zealci@....com.cn>,
        Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH] tests: remove unneeded conversion to bool

On 11/24/21 5:58 PM, davidcomponentone@...il.com wrote:
> From: Yang Guang <yang.guang5@....com.cn>
> 
> 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@....com.cn>
> Signed-off-by: Yang Guang <yang.guang5@....com.cn>
> ---
>   .../selftests/move_mount_set_group/move_mount_set_group_test.c  | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c b/tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c
> index 860198f83a53..80ff0b692486 100644
> --- a/tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c
> +++ b/tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c
> @@ -222,7 +222,7 @@ static int move_mount_set_group_supported(void)
>   		      AT_FDCWD, SET_GROUP_TO, MOVE_MOUNT_SET_GROUP);
>   	umount2("/tmp", MNT_DETACH);
>   
> -	return ret < 0 ? false : true;
> +	return ret >= 0;
>   }
>   
>   FIXTURE(move_mount_set_group) {
> 

In this case it would be better to change the return type for
move_mount_set_group_supported() to bool

thanks,
-- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ