xfs
[Top] [All Lists]

[PATCH 1/2] xfs: suppress spurious uninitialised var warning in xfs_bmap

To: xfs@xxxxxxxxxxx
Subject: [PATCH 1/2] xfs: suppress spurious uninitialised var warning in xfs_bmapi()
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 19 Jan 2010 11:41:50 +1100
In-reply-to: <1263861711-13900-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1263861711-13900-1-git-send-email-david@xxxxxxxxxxxxx>
Initialise the xfs_bmalloca_t structure to zero to avoid uninitialised
variable warnings. This is done by zeroing the arg structure rather than
using the uninitialised_var() trick so we know for certain that the
structure is correctly initialised as xfs_bmapi is a very complex
function and it is difficult to prove warnings are spurious.

Signed-off-by: Dave Chinner <david@xxxxxxxxxxxxx>
---
 fs/xfs/xfs_bmap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 7c6d9ac..1869fb9 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -4471,7 +4471,7 @@ xfs_bmapi(
        xfs_fsblock_t   abno;           /* allocated block number */
        xfs_extlen_t    alen;           /* allocated extent length */
        xfs_fileoff_t   aoff;           /* allocated file offset */
-       xfs_bmalloca_t  bma;            /* args for xfs_bmap_alloc */
+       xfs_bmalloca_t  bma = { 0 };    /* args for xfs_bmap_alloc */
        xfs_btree_cur_t *cur;           /* bmap btree cursor */
        xfs_fileoff_t   end;            /* end of mapped file region */
        int             eof;            /* we've hit the end of extents */
-- 
1.6.5

<Prev in Thread] Current Thread [Next in Thread>