diff mbox series

[-next] xfs: use LIST_HEAD() to simplify code

Message ID 20240821064355.2293091-1-lihongbo22@huawei.com (mailing list archive)
State New
Headers show
Series [-next] xfs: use LIST_HEAD() to simplify code | expand

Commit Message

Hongbo Li Aug. 21, 2024, 6:43 a.m. UTC
list_head can be initialized automatically with LIST_HEAD()
instead of calling INIT_LIST_HEAD().

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
---
 fs/xfs/xfs_mru_cache.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Darrick J. Wong Aug. 21, 2024, 4:21 p.m. UTC | #1
On Wed, Aug 21, 2024 at 02:43:55PM +0800, Hongbo Li wrote:
> list_head can be initialized automatically with LIST_HEAD()
> instead of calling INIT_LIST_HEAD().
> 
> Signed-off-by: Hongbo Li <lihongbo22@huawei.com>

Looks ok,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/xfs/xfs_mru_cache.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/xfs_mru_cache.c b/fs/xfs/xfs_mru_cache.c
> index 7443debaffd6..d0f5b403bdbe 100644
> --- a/fs/xfs/xfs_mru_cache.c
> +++ b/fs/xfs/xfs_mru_cache.c
> @@ -230,9 +230,8 @@ _xfs_mru_cache_clear_reap_list(
>  		__releases(mru->lock) __acquires(mru->lock)
>  {
>  	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) {
>  
>  		/* Remove the element from the data store. */
> -- 
> 2.34.1
> 
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_mru_cache.c b/fs/xfs/xfs_mru_cache.c
index 7443debaffd6..d0f5b403bdbe 100644
--- a/fs/xfs/xfs_mru_cache.c
+++ b/fs/xfs/xfs_mru_cache.c
@@ -230,9 +230,8 @@  _xfs_mru_cache_clear_reap_list(
 		__releases(mru->lock) __acquires(mru->lock)
 {
 	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) {
 
 		/* Remove the element from the data store. */