[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-bcache
Subject:    Re: [PATCH v2 3/3] bcache: Use of hlist_count_nodes()
From:       Andy Shevchenko <andriy.shevchenko () linux ! intel ! com>
Date:       2024-01-06 14:36:27
Message-ID: ZZlla_BYIP_dnLmA () smile ! fi ! intel ! com
[Download RAW message or body]

On Thu, Jan 04, 2024 at 05:49:35PM +0100, Pierre Gondois wrote:
> Make use of the newly added hlist_count_nodes().

...

>  	for (h = c->bucket_hash;
>  	     h < c->bucket_hash + (1 << BUCKET_HASH_BITS);
>  	     h++) {
> -		unsigned int i = 0;
> -		struct hlist_node *p;
> -
> -		hlist_for_each(p, h)
> -			i++;
> -
> -		ret = max(ret, i);
> +		ret = max(ret, hlist_count_nodes(h));
>  	}

After this you probably may drop {}.


-- 
With Best Regards,
Andy Shevchenko



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic