mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][V2] jfs: remove redundant assignments to ipaimap and ipaimap2
@ 2022-10-18 15:23 Colin Ian King
  2022-10-18 15:44 ` Dave Kleikamp
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-10-18 15:23 UTC (permalink / raw)
  To: Dave Kleikamp, jfs-discussion; +Cc: kernel-janitors, linux-kernel

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]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
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(-)

diff --git a/fs/jfs/jfs_umount.c b/fs/jfs/jfs_umount.c
index 3e8b13e6aa01..95ebcd17ce75 100644
--- a/fs/jfs/jfs_umount.c
+++ b/fs/jfs/jfs_umount.c
@@ -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;
-- 
2.37.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][V2] jfs: remove redundant assignments to ipaimap and ipaimap2
  2022-10-18 15:23 [PATCH][V2] jfs: remove redundant assignments to ipaimap and ipaimap2 Colin Ian King
@ 2022-10-18 15:44 ` Dave Kleikamp
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Kleikamp @ 2022-10-18 15:44 UTC (permalink / raw)
  To: Colin Ian King, jfs-discussion; +Cc: kernel-janitors, linux-kernel

Looks good. Applied.

Thanks,
Shaggy

On 10/18/22 10:23AM, Colin Ian King wrote:
> 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]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> 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(-)
> 
> diff --git a/fs/jfs/jfs_umount.c b/fs/jfs/jfs_umount.c
> index 3e8b13e6aa01..95ebcd17ce75 100644
> --- a/fs/jfs/jfs_umount.c
> +++ b/fs/jfs/jfs_umount.c
> @@ -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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-18 15:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-18 15:23 [PATCH][V2] jfs: remove redundant assignments to ipaimap and ipaimap2 Colin Ian King
2022-10-18 15:44 ` Dave Kleikamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®