From 273946a5c507ff5bce12349143470e8629bbe0a7 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sun, 1 Apr 2012 18:57:59 +0300 Subject: UBIFS: remove douple initialization in change_category() "heap" is initialized twice. I removed the first one, because it makes Smatch complain that we use "new_cat" as an offset before checking it. This doesn't change how the code works, it's just a cleanup. Signed-off-by: Dan Carpenter Signed-off-by: Artem Bityutskiy --- fs/ubifs/lprops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/ubifs/lprops.c') diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c index f8a181e647c..b5c95a69d95 100644 --- a/fs/ubifs/lprops.c +++ b/fs/ubifs/lprops.c @@ -447,7 +447,7 @@ static void change_category(struct ubifs_info *c, struct ubifs_lprops *lprops) int new_cat = ubifs_categorize_lprops(c, lprops); if (old_cat == new_cat) { - struct ubifs_lpt_heap *heap = &c->lpt_heap[new_cat - 1]; + struct ubifs_lpt_heap *heap; /* lprops on a heap now must be moved up or down */ if (new_cat < 1 || new_cat > LPROPS_HEAP_CNT) -- cgit v1.2.3 From 7c46d0ae29ba880963db283706950de7aa86c0a0 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Wed, 16 May 2012 19:04:54 +0300 Subject: UBIFS: get rid of dbg_dump_stack In case of errors we almost always need the stack dump - it makes no sense to compile it out. Remove the 'dbg_dump_stack()' function completely. Signed-off-by: Artem Bityutskiy --- fs/ubifs/lprops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/ubifs/lprops.c') diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c index b5c95a69d95..2e4bc27fb02 100644 --- a/fs/ubifs/lprops.c +++ b/fs/ubifs/lprops.c @@ -1001,7 +1001,7 @@ void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat, out: if (err) { dbg_msg("failed cat %d hpos %d err %d", cat, i, err); - dbg_dump_stack(); + dump_stack(); dbg_dump_heap(c, heap, cat); } } -- cgit v1.2.3 From edf6be245fd34a4438646375cecb11f5feb92646 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Wed, 16 May 2012 19:15:56 +0300 Subject: UBIFS: rename dumping functions This commit re-names all functions which dump something from "dbg_dump_*()" to "ubifs_dump_*()". This is done for consistency with UBI and because this way it will be more logical once we remove the debugging sompilation option. Signed-off-by: Artem Bityutskiy --- fs/ubifs/lprops.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fs/ubifs/lprops.c') diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c index 2e4bc27fb02..0cf7a18e174 100644 --- a/fs/ubifs/lprops.c +++ b/fs/ubifs/lprops.c @@ -1002,7 +1002,7 @@ out: if (err) { dbg_msg("failed cat %d hpos %d err %d", cat, i, err); dump_stack(); - dbg_dump_heap(c, heap, cat); + ubifs_dump_heap(c, heap, cat); } } @@ -1109,8 +1109,8 @@ static int scan_check_cb(struct ubifs_info *c, if (IS_ERR(sleb)) { ret = PTR_ERR(sleb); if (ret == -EUCLEAN) { - dbg_dump_lprops(c); - dbg_dump_budg(c, &c->bi); + ubifs_dump_lprops(c); + ubifs_dump_budg(c, &c->bi); } goto out; } @@ -1237,7 +1237,7 @@ out_print: ubifs_err("bad accounting of LEB %d: free %d, dirty %d flags %#x, " "should be free %d, dirty %d", lnum, lp->free, lp->dirty, lp->flags, free, dirty); - dbg_dump_leb(c, lnum); + ubifs_dump_leb(c, lnum); out_destroy: ubifs_scan_destroy(sleb); ret = -EINVAL; -- cgit v1.2.3 From f70b7e52aa23c9aea5346b9730b402fb55f9079b Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Wed, 16 May 2012 19:53:46 +0300 Subject: UBIFS: remove Kconfig debugging option Have the debugging stuff always compiled-in instead. It simplifies maintanance a lot. Signed-off-by: Artem Bityutskiy --- fs/ubifs/lprops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fs/ubifs/lprops.c') diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c index 0cf7a18e174..86eb8e53324 100644 --- a/fs/ubifs/lprops.c +++ b/fs/ubifs/lprops.c @@ -846,7 +846,9 @@ const struct ubifs_lprops *ubifs_fast_find_frdi_idx(struct ubifs_info *c) return lprops; } -#ifdef CONFIG_UBIFS_FS_DEBUG +/* + * Everything below is related to debugging. + */ /** * dbg_check_cats - check category heaps and lists. @@ -1315,5 +1317,3 @@ int dbg_check_lprops(struct ubifs_info *c) out: return err; } - -#endif /* CONFIG_UBIFS_FS_DEBUG */ -- cgit v1.2.3