[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240104164937.424320-4-pierre.gondois@arm.com>
Date: Thu, 4 Jan 2024 17:49:35 +0100
From: Pierre Gondois <pierre.gondois@....com>
To: linux-kernel@...r.kernel.org
Cc: Pierre Gondois <pierre.gondois@....com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Arve Hjønnevåg <arve@...roid.com>,
Todd Kjos <tkjos@...roid.com>,
Martijn Coenen <maco@...roid.com>,
Joel Fernandes <joel@...lfernandes.org>,
Christian Brauner <brauner@...nel.org>,
Carlos Llamas <cmllamas@...gle.com>,
Suren Baghdasaryan <surenb@...gle.com>,
Coly Li <colyli@...e.de>,
Kent Overstreet <kent.overstreet@...il.com>,
Marco Elver <elver@...gle.com>,
Kees Cook <keescook@...omium.org>,
Lucas De Marchi <lucas.demarchi@...el.com>,
Ingo Molnar <mingo@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-bcache@...r.kernel.org
Subject: [PATCH v2 3/3] bcache: Use of hlist_count_nodes()
Make use of the newly added hlist_count_nodes().
Signed-off-by: Pierre Gondois <pierre.gondois@....com>
---
drivers/md/bcache/sysfs.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index a438efb66069..6956beb55326 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -702,13 +702,7 @@ static unsigned int bch_cache_max_chain(struct cache_set *c)
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));
}
mutex_unlock(&c->bucket_lock);
--
2.25.1
Powered by blists - more mailing lists