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]
Message-ID: <4c266f0d-3d98-da0f-6c31-4afe922a2d0c@suse.de>
Date:   Wed, 24 Jun 2020 22:51:31 +0800
From:   Coly Li <colyli@...e.de>
To:     Xu Wang <vulab@...as.ac.cn>
Cc:     kent.overstreet@...il.com, linux-bcache@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] bcache: journel: use for_each_clear_bit() to simplify the
 code

On 2020/6/24 14:52, Xu Wang wrote:
> Using for_each_clear_bit() to simplify the code.
> 
> Signed-off-by: Xu Wang <vulab@...as.ac.cn>

It looks good to me, I will add it in my testing patches.

Thanks.

Coly Li

> ---
>  drivers/md/bcache/journal.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c
> index 90aac4e2333f..b01c953e214c 100644
> --- a/drivers/md/bcache/journal.c
> +++ b/drivers/md/bcache/journal.c
> @@ -217,10 +217,7 @@ int bch_journal_read(struct cache_set *c, struct list_head *list)
>  		 */
>  		pr_debug("falling back to linear search\n");
>  
> -		for (l = find_first_zero_bit(bitmap, ca->sb.njournal_buckets);
> -		     l < ca->sb.njournal_buckets;
> -		     l = find_next_zero_bit(bitmap, ca->sb.njournal_buckets,
> -					    l + 1))
> +		for_each_clear_bit(l, bitmap, ca->sb.njournal_buckets)
>  			if (read_bucket(l))
>  				goto bsearch;
>  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ