ocfs2: Fix 2 warning during ocfs2 make.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Saturday, May 2, 2009 - 5:00 pm

Gitweb:     http://git.kernel.org/linus/0fba813748f16f4eaf24d492c505226c4026d58f
Commit:     0fba813748f16f4eaf24d492c505226c4026d58f
Parent:     035a571120ddbe4f92b91bbe46f3eff05b6e43eb
Author:     Tao Ma <tao.ma@oracle.com>
AuthorDate: Thu Mar 19 05:08:43 2009 +0800
Committer:  Joel Becker <joel.becker@oracle.com>
CommitDate: Tue Apr 21 16:23:39 2009 -0700

    ocfs2: Fix 2 warning during ocfs2 make.
    
    fs/ocfs2/dir.c: In function ‘ocfs2_extend_dir’:
    fs/ocfs2/dir.c:2700: warning: ‘ret’ may be used uninitialized in this function
    
    fs/ocfs2/suballoc.c: In function ‘ocfs2_get_suballoc_slot_bit’:
    fs/ocfs2/suballoc.c:2216: warning: comparison is always true due to limited range of data type
    
    Signed-off-by: Tao Ma <tao.ma@oracle.com>
    Signed-off-by: Joel Becker <joel.becker@oracle.com>
---
 fs/ocfs2/dir.c      |    2 +-
 fs/ocfs2/suballoc.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
index 07d8920..c575230 100644
--- a/fs/ocfs2/dir.c
+++ b/fs/ocfs2/dir.c
@@ -2697,7 +2697,7 @@ static int ocfs2_dx_dir_index_block(struct inode *dir,
 				    u32 *num_dx_entries,
 				    struct buffer_head *dirent_bh)
 {
-	int ret, namelen, i;
+	int ret = 0, namelen, i;
 	char *de_buf, *limit;
 	struct ocfs2_dir_entry *de;
 	struct buffer_head *dx_leaf_bh;
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
index b4ca591..eb21dbb 100644
--- a/fs/ocfs2/suballoc.c
+++ b/fs/ocfs2/suballoc.c
@@ -2213,7 +2213,7 @@ static int ocfs2_get_suballoc_slot_bit(struct ocfs2_super *osb, u64 blkno,
 		goto bail;
 	}
 
-	if (le16_to_cpu(inode_fe->i_suballoc_slot) != OCFS2_INVALID_SLOT &&
+	if (le16_to_cpu(inode_fe->i_suballoc_slot) != (u16)OCFS2_INVALID_SLOT &&
 	    (u32)le16_to_cpu(inode_fe->i_suballoc_slot) > osb->max_slots - 1) {
 		mlog(ML_ERROR, "inode %llu has invalid suballoc slot %u\n",
 		     blkno, (u32)le16_to_cpu(inode_fe->i_suballoc_slot));
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ocfs2: Fix 2 warning during ocfs2 make., Linux Kernel Mailing ..., (Sat May 2, 5:00 pm)