Re: [PATCH v2 3/3] bcache: Use of hlist_count_nodes()

From: Andy Shevchenko
Date: Sat Jan 06 2024 - 09:36:49 EST


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