From: Subrata Modak Date: Mon, 13 Jul 2009 19:49:31 +0000 (+0530) Subject: ocfs2: Fix compilation warning for fs/ocfs2/xattr.c X-Git-Tag: v2.6.31-rc6~5^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44d8e4e1e9b941065eb7578669fe51eb65c73e63;p=platform%2Fkernel%2Flinux-stable.git ocfs2: Fix compilation warning for fs/ocfs2/xattr.c gcc 4.4.1 generates the following build warning on i386: CC [M] fs/ocfs2/xattr.o fs/ocfs2/xattr.c: In function ‘ocfs2_xattr_block_get’: fs/ocfs2/xattr.c:1055: warning: ‘block_off’ may be used uninitialized in this function The following fix is based on a similar approach by David Howells few days back: http://lkml.org/lkml/2009/7/9/109, Signed-off-by: Subrata Modak, Signed-off-by: Joel Becker --- diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index ba320e2..d1a27cd 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c @@ -1052,7 +1052,8 @@ static int ocfs2_xattr_block_get(struct inode *inode, struct ocfs2_xattr_block *xb; struct ocfs2_xattr_value_root *xv; size_t size; - int ret = -ENODATA, name_offset, name_len, block_off, i; + int ret = -ENODATA, name_offset, name_len, i; + int uninitialized_var(block_off); xs->bucket = ocfs2_xattr_bucket_new(inode); if (!xs->bucket) {