Skip to contentSkip to conversation

jfs: remove redundant assignments to ipaimap and ipaimap2

PATCH In review Colin Ian King 2 participants 2 messages Oct 18, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 jfs: remove redundant assignments to ipaimap and ipaimap2

The pointers ipaimap and ipaimap2 are re-assigned with values a second time with the same values when they were initialized. The re-assignments are redundant and can be removed.

Cleans up two clang scan build warnings:
fs/jfs/jfs_umount.c:42:16: warning: Value stored to 'ipaimap' during its initialization is never read [deadcode.DeadStores]

fs/jfs/jfs_umount.c:43:16: warning: Value stored to 'ipaimap2' during its initialization is never read [deadcode.DeadStores]

---
V2: remove re-assignments rather than initializations as per the
recommendation from Dave Kleikamp

---
 fs/jfs/jfs_umount.c | 2 --
 1 file changed, 2 deletions(-)
fs/jfs/jfs_umount.c +0 -2
index 3e8b13e6aa01..95ebcd17ce75 100644
@@ -68,7 +68,6 @@ int jfs_umount(struct super_block *sb)
 	/*
 	 * close secondary aggregate inode allocation map
 	 */
-	ipaimap2 = sbi->ipaimap2;
 	if (ipaimap2) {
 		diUnmount(ipaimap2, 0);
 		diFreeSpecial(ipaimap2);
@@ -78,7 +77,6 @@ int jfs_umount(struct super_block *sb)
 	/*
 	 * close aggregate inode allocation map
 	 */
-	ipaimap = sbi->ipaimap;
 	diUnmount(ipaimap, 0);
 	diFreeSpecial(ipaimap);
 	sbi->ipaimap = NULL;
Signature · 1 line
2.37.3
#1 lore raw

Looks good. Applied.

Thanks,
Shaggy

Quoted 39 lines · Colin Ian King

The pointers ipaimap and ipaimap2 are re-assigned with values a second time with the same values when they were initialized. The re-assignments are redundant and can be removed.

Cleans up two clang scan build warnings:
fs/jfs/jfs_umount.c:42:16: warning: Value stored to 'ipaimap' during its initialization is never read [deadcode.DeadStores]

fs/jfs/jfs_umount.c:43:16: warning: Value stored to 'ipaimap2' during its initialization is never read [deadcode.DeadStores]

---
V2: remove re-assignments rather than initializations as per the
recommendation from Dave Kleikamp

---
  fs/jfs/jfs_umount.c | 2 --
  1 file changed, 2 deletions(-)
fs/jfs/jfs_umount.c +0 -2
index 3e8b13e6aa01..95ebcd17ce75 100644
@@ -68,7 +68,6 @@ int jfs_umount(struct super_block *sb)
  	/*
  	 * close secondary aggregate inode allocation map
  	 */
-	ipaimap2 = sbi->ipaimap2;
  	if (ipaimap2) {
  		diUnmount(ipaimap2, 0);
  		diFreeSpecial(ipaimap2);
@@ -78,7 +77,6 @@ int jfs_umount(struct super_block *sb)
  	/*
  	 * close aggregate inode allocation map
  	 */
-	ipaimap = sbi->ipaimap;
  	diUnmount(ipaimap, 0);
  	diFreeSpecial(ipaimap);
  	sbi->ipaimap = NULL;