[PATCH 2/4] jffs2: fix sparse warning in nodemgmt.c

Harvey Harrison
2008-02-16T03:22:59Z

fs/jffs2/nodemgmt.c:60:8: warning: symbol 'ret' shadows an earlier one
fs/jffs2/nodemgmt.c:45:6: originally declared here

Use a different var (gc) in the inner loop to test the condition.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
fs/jffs2/nodemgmt.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c
index a0313fa..96faa70 100644
--- a/fs/jffs2/nodemgmt.c
+++ b/fs/jffs2/nodemgmt.c
@@ -57,7 +57,7 @@ int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize,
/* this needs a little more thought (true <tglx> :)) */
while(ret == -EAGAIN) {
while(c->nr_free_blocks + c->nr_erasing_blocks < blocksneeded) {
- int ret;
+ int gc;
uint32_t dirty, avail;

/* calculate real dirty size
@@ -116,9 +116,9 @@ int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize,
c->free_size + c->dirty_size + c->wasted_size + c->used_size + c->erasing_size + c->bad_size, c->flash_size));
spin_unlock(&c->erase_completion_lock);

- ret = jffs2_garbage_collect_pass(c);
- if (ret)
- return ret;
+ gc = jffs2_garbage_collect_pass(c);
+ if (gc)
+ return gc;

cond_resched();

--
1.5.4.1.1278.gc75be