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]
Date:   Fri, 14 Apr 2023 18:55:38 +0200
From:   Jan Kara <jack@...e.cz>
To:     wuchi <wuchi.zero@...il.com>
Cc:     tytso@....edu, adilger.kernel@...ger.ca,
        linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ext4: remove useless conditional branch code

On Sat 01-04-23 15:53:03, wuchi wrote:
> It's ok because the code will be optimized by the compiler, just
> try to simple the code.
> 
> Signed-off-by: wuchi <wuchi.zero@...il.com>

Sure. Feel free to add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza
> 
> diff --git a/fs/ext4/bitmap.c b/fs/ext4/bitmap.c
> index 87c1c8ae9298..cd725bebe69e 100644
> --- a/fs/ext4/bitmap.c
> +++ b/fs/ext4/bitmap.c
> @@ -74,10 +74,7 @@ int ext4_block_bitmap_csum_verify(struct super_block *sb,
>  	} else
>  		calculated &= 0xFFFF;
>  
> -	if (provided == calculated)
> -		return 1;
> -
> -	return 0;
> +	return provided == calculated;
>  }
>  
>  void ext4_block_bitmap_csum_set(struct super_block *sb,
> -- 
> 2.20.1
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists