lkml.org 
[lkml]   [2023]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@gmail.com>

Sure. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.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@suse.com>
SUSE Labs, CR

\
 
 \ /
  Last update: 2023-04-14 18:59    [W:0.044 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site