xfs: fix sparse warning on allocation cursor initialization
diff mbox series

Message ID 20191021131404.30089-1-bfoster@redhat.com
State New
Headers show
Series
  • xfs: fix sparse warning on allocation cursor initialization
Related show

Commit Message

Brian Foster Oct. 21, 2019, 1:14 p.m. UTC
sparse complains about the initialization used for the allocation
cursor:

>> fs/xfs/libxfs/xfs_alloc.c:1170:41: sparse: sparse: Using plain integer as NULL pointer

Fix it by removing the unnecessary initialization value.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Brian Foster <bfoster@redhat.com>
---
 fs/xfs/libxfs/xfs_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Darrick J. Wong Oct. 21, 2019, 3:45 p.m. UTC | #1
On Mon, Oct 21, 2019 at 09:14:04AM -0400, Brian Foster wrote:
> sparse complains about the initialization used for the allocation
> cursor:
> 
> >> fs/xfs/libxfs/xfs_alloc.c:1170:41: sparse: sparse: Using plain integer as NULL pointer
> 
> Fix it by removing the unnecessary initialization value.
> 
> Reported-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Brian Foster <bfoster@redhat.com>

Looks ok, though I have to rebase the iomap / xfs branches anyway so I
might apply this to the original patch.

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/libxfs/xfs_alloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index e9f74eb92073..925eba9489d5 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -1471,7 +1471,7 @@ STATIC int
>  xfs_alloc_ag_vextent_near(
>  	struct xfs_alloc_arg	*args)
>  {
> -	struct xfs_alloc_cur	acur = {0,};
> +	struct xfs_alloc_cur	acur = {};
>  	int			error;		/* error code */
>  	int			i;		/* result code, temporary */
>  	xfs_agblock_t		bno;
> -- 
> 2.20.1
>

Patch
diff mbox series

diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
index e9f74eb92073..925eba9489d5 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -1471,7 +1471,7 @@  STATIC int
 xfs_alloc_ag_vextent_near(
 	struct xfs_alloc_arg	*args)
 {
-	struct xfs_alloc_cur	acur = {0,};
+	struct xfs_alloc_cur	acur = {};
 	int			error;		/* error code */
 	int			i;		/* result code, temporary */
 	xfs_agblock_t		bno;