linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] reiserfs: fix set but not used variable 'blkh'
@ 2019-08-23  9:42 yu kuai
  0 siblings, 0 replies; only message in thread
From: yu kuai @ 2019-08-23  9:42 UTC (permalink / raw)
  To: reiserfs-devel, linux-kernel; +Cc: zhengbin13, yukuai3, yi.zhang

Gcc '-Wunused-but-set-variable' warning: 
fs/reiserfs/prints.c:749:21: warning: variable blkh set but not used

Fix it by using blkh instead of regenerating it by B_BLK_HEAD(bh)

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: yu kuai <yukuai3@huawei.com>
---
 fs/reiserfs/prints.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c
index 9fed1c0..590d42b 100644
--- a/fs/reiserfs/prints.c
+++ b/fs/reiserfs/prints.c
@@ -749,15 +749,16 @@ static void check_internal_block_head(struct buffer_head *bh)
 	struct block_head *blkh;
 
 	blkh = B_BLK_HEAD(bh);
-	if (!(B_LEVEL(bh) > DISK_LEAF_NODE_LEVEL && B_LEVEL(bh) <= MAX_HEIGHT))
+	if (!(blkh_level(blkh) > DISK_LEAF_NODE_LEVEL &&
+		blkh_level(blkh) <= MAX_HEIGHT))
 		reiserfs_panic(NULL, "vs-6025", "invalid level %z", bh);
 
-	if (B_NR_ITEMS(bh) > (bh->b_size - BLKH_SIZE) / IH_SIZE)
+	if (blkh_nr_item(blkh) > (bh->b_size - BLKH_SIZE) / IH_SIZE)
 		reiserfs_panic(NULL, "vs-6030", "invalid item number %z", bh);
 
-	if (B_FREE_SPACE(bh) !=
-	    bh->b_size - BLKH_SIZE - KEY_SIZE * B_NR_ITEMS(bh) -
-	    DC_SIZE * (B_NR_ITEMS(bh) + 1))
+	if (blkh_free_space(p_blkh) !=
+	    bh->b_size - BLKH_SIZE - KEY_SIZE * blkh_nr_item(blkh) -
+	    DC_SIZE * (blkh_nr_item(blkh) + 1))
 		reiserfs_panic(NULL, "vs-6040", "invalid free space %z", bh);
 
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-23  9:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-23  9:42 [PATCH] reiserfs: fix set but not used variable 'blkh' yu kuai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).