Re: [PATCH] nilfs2: Remove an uninitialization warning in nilfs_btree_propagate_v()

Previous thread: Re: [PATCH 0/3] add support for Janz MODULbus devices by Samuel Ortiz on Friday, April 2, 2010 - 3:00 am. (1 message)

Next thread: [PATCH 1/2] nilfs2: Combine nilfs_btree_alloc_path() and nilfs_btree_init_path() by Li Hong on Friday, April 2, 2010 - 3:42 am. (4 messages)
From: Li Hong
Date: Friday, April 2, 2010 - 3:40 am

`make CONFIG_NILFS2_FS=m M=fs/nilfs2/` will give the following warnings:

fs/nilfs2/btree.c: In function ‘nilfs_btree_propagate’:
fs/nilfs2/btree.c:1882: warning: ‘maxlevel’ may be used uninitialized in this function
fs/nilfs2/btree.c:1882: note: ‘maxlevel’ was declared here

Set maxlevel = 0 to fix it.

Signed-off-by: Li Hong <lihong.hi@gmail.com>
---
 fs/nilfs2/btree.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c
index 7cdd98b..76c38e3 100644
--- a/fs/nilfs2/btree.c
+++ b/fs/nilfs2/btree.c
@@ -1879,7 +1879,7 @@ static int nilfs_btree_propagate_v(struct nilfs_btree *btree,
 				   struct nilfs_btree_path *path,
 				   int level, struct buffer_head *bh)
 {
-	int maxlevel, ret;
+	int maxlevel = 0, ret;
 	struct nilfs_btree_node *parent;
 	struct inode *dat = nilfs_bmap_get_dat(&btree->bt_bmap);
 	__u64 ptr;
-- 
1.6.3.3

--

From: Ryusuke Konishi
Date: Friday, April 2, 2010 - 4:09 am

Applied, thanks.

--

Previous thread: Re: [PATCH 0/3] add support for Janz MODULbus devices by Samuel Ortiz on Friday, April 2, 2010 - 3:00 am. (1 message)

Next thread: [PATCH 1/2] nilfs2: Combine nilfs_btree_alloc_path() and nilfs_btree_init_path() by Li Hong on Friday, April 2, 2010 - 3:42 am. (4 messages)