Skip to contentSkip to conversation

Fix compilation warning for fs/ocfs2/xattr.c

PATCH In review Subrata Modak 2 participants 2 messages Jul 13, 2009 – Jul 21, 2009 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix compilation warning for fs/ocfs2/xattr.c

Hi,

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,

---

fs/ocfs2/xattr.c +2 -1
@@ -1052,7 +1052,8 @@ static int ocfs2_xattr_block_get(struct 
 	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) {

---
Regards--
Subrata

#1 lore raw
Quoted 10 lines · Subrata Modak

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,

This is now in the fixes branch of ocfs2.git.

Joel

Signature · 9 lines
Life's Little Instruction Book #15

	"Own a great stereo system."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127