- [10/15] - remove defconfig ptr comparisons to 0 - fs/reiserfs
PATCH 1/1 - [10/15] - remove defconfig ptr comparisons to 0 - fs/reiserfs
Remove defconfig ptr comparison to 0
Remove sparse warning: Using plain integer as NULL pointer
Signed-off-by Joe Perches <[email protected]>
---
fs/reiserfs/do_balan.c +2 -2
@@ -283,7 +283,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item hreturn balance_leaf_when_delete (tb, flag); zeros_num =0 ; -if (flag ==M_INSERT && body ==0 ) +if (flag ==M_INSERT && !body) zeros_num =ih_item_len (ih); pos_in_item = tb->tb_path->pos_in_item;
@@ -1728,7 +1728,7 @@ struct buffer_head *get_FEB(struct tree_balance *tb)struct buffer_info bi;for (i =0 ; i <MAX_FEB_SIZE ; i++) -if (tb->FEB[i] !=0 ) +if (tb->FEB[i])break ;if (i ==MAX_FEB_SIZE )
fs/reiserfs/fix_node.c +2 -2
@@ -857,7 +857,7 @@ static int get_lfree(struct tree_balance *tb, int h)struct buffer_head *l, *f;int order; -if ((f =PATH_H_PPARENT (tb->tb_path, h)) ==0 || (l = tb->FL[h]) ==0 ) +if (!(f =PATH_H_PPARENT (tb->tb_path, h)) || !(l = tb->FL[h]))return 0 ;if (f == l)
@@ -878,7 +878,7 @@ static int get_rfree(struct tree_balance *tb, int h)struct buffer_head *r, *f;int order; -if ((f =PATH_H_PPARENT (tb->tb_path, h)) ==0 || (r = tb->FR[h]) ==0 ) +if (!(f =PATH_H_PPARENT (tb->tb_path, h)) || !(r = tb->FR[h]))return 0 ;if (f == r)
fs/reiserfs/namei.c +1 -1
@@ -452,7 +452,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, buflen =DEH_SIZE +ROUND_UP (namelen);if (buflen >sizeof (small_buf)) { buffer =kmalloc (buflen,GFP_NOFS ); -if (buffer ==0 ) +if (!buffer)return -ENOMEM ; }else buffer = small_buf;