* [PATCH -next] xfs: use LIST_HEAD() to simplify code
@ 2024-08-21 6:43 Hongbo Li
2024-08-21 16:21 ` Darrick J. Wong
0 siblings, 1 reply; 2+ messages in thread
From: Hongbo Li @ 2024-08-21 6:43 UTC (permalink / raw)
To: chandan.babu, djwong; +Cc: linux-xfs, lihongbo22
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(-)
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] xfs: use LIST_HEAD() to simplify code
2024-08-21 6:43 [PATCH -next] xfs: use LIST_HEAD() to simplify code Hongbo Li
@ 2024-08-21 16:21 ` Darrick J. Wong
0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2024-08-21 16:21 UTC (permalink / raw)
To: Hongbo Li; +Cc: chandan.babu, linux-xfs
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
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-21 16:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-21 6:43 [PATCH -next] xfs: use LIST_HEAD() to simplify code Hongbo Li
2024-08-21 16:21 ` Darrick J. Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox