Skip to contentSkip to conversation

xfs: Remove redundant assignment of mp

PATCH In review Jiapeng Chong 2 participants 2 messages Jan 5, 2022 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xfs: Remove redundant assignment of mp

mp is being initialized to log->l_mp but this is never read as record is overwritten later on. Remove the redundant assignment.

Cleans up the following clang-analyzer warning:

fs/xfs/xfs_log_recover.c:3543:20: warning: Value stored to 'mp' during its initialization is never read [clang-analyzer-deadcode.DeadStores].

---
Changes in v2:
-Remove mp = log->l_mp.

 fs/xfs/xfs_log_recover.c | 2 --
 1 file changed, 2 deletions(-)
fs/xfs/xfs_log_recover.c +0 -2
index 8ecb9a8567b7..96c997ed2ec8 100644
@@ -3550,8 +3550,6 @@ xlog_recover_check_summary(
 	uint64_t		ifree;
 	int			error;
 
-	mp = log->l_mp;
-
 	freeblks = 0LL;
 	itotal = 0LL;
 	ifree = 0LL;
Signature · 1 line
2.20.1.7.g153144c
Reviewed-by on v2 1/1
#1 lore raw
Quoted 11 lines · Jiapeng Chong

mp is being initialized to log->l_mp but this is never read as record is overwritten later on. Remove the redundant assignment.

Cleans up the following clang-analyzer warning:

fs/xfs/xfs_log_recover.c:3543:20: warning: Value stored to 'mp' during its initialization is never read [clang-analyzer-deadcode.DeadStores].

Much improved, thank you.

--D

Quoted 23 lines

---
Changes in v2:
-Remove mp = log->l_mp.

 fs/xfs/xfs_log_recover.c | 2 --
 1 file changed, 2 deletions(-)
fs/xfs/xfs_log_recover.c +0 -2
index 8ecb9a8567b7..96c997ed2ec8 100644
@@ -3550,8 +3550,6 @@ xlog_recover_check_summary(
 	uint64_t		ifree;
 	int			error;
 
-	mp = log->l_mp;
-
 	freeblks = 0LL;
 	itotal = 0LL;
 	ifree = 0LL;
Signature · 1 line
2.20.1.7.g153144c