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] [day] [month] [year] [list]
Date:   Mon, 19 Nov 2018 19:55:09 -0700
From:   Andreas Dilger <adilger@...ger.ca>
To:     Chengguang Xu <cgxu519@....com>
Cc:     "Theodore Y . Ts'o" <tytso@....edu>,
        Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH] ext4: change variable reusable to bool type

On Nov 14, 2018, at 11:41 PM, Chengguang Xu <cgxu519@....com> wrote:
> 
> Reusable parameter of mb_cache_entry_create() is bool type,
> so change variable resuable to bool type from int.
> 
> Signed-off-by: Chengguang Xu <cgxu519@....com>
> ---
> fs/ext4/xattr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
> index 7643d52c776c..cda5dd16a8cb 100644
> --- a/fs/ext4/xattr.c
> +++ b/fs/ext4/xattr.c
> @@ -2979,8 +2979,8 @@ ext4_xattr_block_cache_insert(struct mb_cache *ea_block_cache,
> {
> 	struct ext4_xattr_header *header = BHDR(bh);
> 	__u32 hash = le32_to_cpu(header->h_hash);
> -	int reusable = le32_to_cpu(header->h_refcount) <
> -		       EXT4_XATTR_REFCOUNT_MAX;
> +	bool reusable = (le32_to_cpu(header->h_refcount) <
> +		       EXT4_XATTR_REFCOUNT_MAX) ? true : false;

You don't need to add the "? true : false" at the end here.  The
statement "le32_to_cpu(header->h_refcount) < EXT4_XATTR_REFCOUNT_MAX"
is itself already a boolean value.

Cheers, Andreas






Download attachment "signature.asc" of type "application/pgp-signature" (874 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ