ocfs2: Fix 2 warning during ocfs2 make.
authorTao Ma <tao.ma@oracle.com>
Wed, 18 Mar 2009 21:08:43 +0000 (05:08 +0800)
committerJoel Becker <joel.becker@oracle.com>
Tue, 21 Apr 2009 23:23:39 +0000 (16:23 -0700)
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
fs/ocfs2/suballoc.c

index 07d89204f0d33d8c4078ac4ec458e26768e2eba8..c5752305627c669359f6e6cd688b9f3eecbb6958 100644 (file)
@@ -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;
index b4ca5911caafc3824f6cc8c1a61e69f5a316c4eb..eb21dbb0ee0b7986c0bb8431927b7c0e7e16feb0 100644 (file)
@@ -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));