xfs: use LIST_HEAD() to simplify code

list_head can be initialized automatically with LIST_HEAD()
instead of calling INIT_LIST_HEAD().

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
This commit is contained in:
Hongbo Li 2024-08-21 14:43:55 +08:00 committed by Chandan Babu R
parent 9db384feea
commit 70045dafdf

View File

@ -230,9 +230,8 @@ _xfs_mru_cache_clear_reap_list(
__releases(mru->lock) __acquires(mru->lock) __releases(mru->lock) __acquires(mru->lock)
{ {
struct xfs_mru_cache_elem *elem, *next; struct xfs_mru_cache_elem *elem, *next;
struct list_head tmp; LIST_HEAD(tmp);
INIT_LIST_HEAD(&tmp);
list_for_each_entry_safe(elem, next, &mru->reap_list, list_node) { list_for_each_entry_safe(elem, next, &mru->reap_list, list_node) {
/* Remove the element from the data store. */ /* Remove the element from the data store. */