Re: [PATCH 2/8] xfs: list entry elements don't need to be initialized

Brian Foster
2021-06-17T16:23:11Z

On Wed, Jun 16, 2021 at 06:32:06PM +0200, Christoph Hellwig wrote:
> list_add does not require the added element to be initialized.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

> fs/xfs/xfs_log.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> index 8999c78f3ac6d9..32cb0fc459a364 100644
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -851,7 +851,7 @@ xlog_write_unmount_record(
> .lv_iovecp = &reg,
> };
> LIST_HEAD(lv_chain);
> - INIT_LIST_HEAD(&vec.lv_list);
> +
> list_add(&vec.lv_list, &lv_chain);
>
> BUILD_BUG_ON((sizeof(struct xlog_op_header) +
> @@ -1587,7 +1587,7 @@ xlog_commit_record(
> };
> int error;
> LIST_HEAD(lv_chain);
> - INIT_LIST_HEAD(&vec.lv_list);
> +
> list_add(&vec.lv_list, &lv_chain);
>
> if (XLOG_FORCED_SHUTDOWN(log))
> --
> 2.30.2
>