All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fsnotify: remove redundant parameter judgment
@ 2022-03-11 15:12 Bang Li
  2022-03-14  8:05 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Bang Li @ 2022-03-11 15:12 UTC (permalink / raw)
  To: jack, amir73il; +Cc: linux-fsdevel, linux-kernel, Bang Li

iput() has already judged the incoming parameter, so there is no need to
repeat the judgment here.

Signed-off-by: Bang Li <libang.linuxer@gmail.com>
---
 fs/notify/fsnotify.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index 494f653efbc6..70a8516b78bc 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -70,8 +70,7 @@ static void fsnotify_unmount_inodes(struct super_block *sb)
 		spin_unlock(&inode->i_lock);
 		spin_unlock(&sb->s_inode_list_lock);
 
-		if (iput_inode)
-			iput(iput_inode);
+		iput(iput_inode);
 
 		/* for each watch, send FS_UNMOUNT and then remove it */
 		fsnotify_inode(inode, FS_UNMOUNT);
@@ -85,8 +84,7 @@ static void fsnotify_unmount_inodes(struct super_block *sb)
 	}
 	spin_unlock(&sb->s_inode_list_lock);
 
-	if (iput_inode)
-		iput(iput_inode);
+	iput(iput_inode);
 }
 
 void fsnotify_sb_delete(struct super_block *sb)
-- 
2.25.1


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

* Re: [PATCH] fsnotify: remove redundant parameter judgment
  2022-03-11 15:12 [PATCH] fsnotify: remove redundant parameter judgment Bang Li
@ 2022-03-14  8:05 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2022-03-14  8:05 UTC (permalink / raw)
  To: Bang Li; +Cc: jack, amir73il, linux-fsdevel, linux-kernel

On Fri 11-03-22 23:12:40, Bang Li wrote:
> iput() has already judged the incoming parameter, so there is no need to
> repeat the judgment here.
> 
> Signed-off-by: Bang Li <libang.linuxer@gmail.com>

Thanks. I've applied the patch to my tree.

								Honza

> ---
>  fs/notify/fsnotify.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
> index 494f653efbc6..70a8516b78bc 100644
> --- a/fs/notify/fsnotify.c
> +++ b/fs/notify/fsnotify.c
> @@ -70,8 +70,7 @@ static void fsnotify_unmount_inodes(struct super_block *sb)
>  		spin_unlock(&inode->i_lock);
>  		spin_unlock(&sb->s_inode_list_lock);
>  
> -		if (iput_inode)
> -			iput(iput_inode);
> +		iput(iput_inode);
>  
>  		/* for each watch, send FS_UNMOUNT and then remove it */
>  		fsnotify_inode(inode, FS_UNMOUNT);
> @@ -85,8 +84,7 @@ static void fsnotify_unmount_inodes(struct super_block *sb)
>  	}
>  	spin_unlock(&sb->s_inode_list_lock);
>  
> -	if (iput_inode)
> -		iput(iput_inode);
> +	iput(iput_inode);
>  }
>  
>  void fsnotify_sb_delete(struct super_block *sb)
> -- 
> 2.25.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

end of thread, other threads:[~2022-03-14  8:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-11 15:12 [PATCH] fsnotify: remove redundant parameter judgment Bang Li
2022-03-14  8:05 ` Jan Kara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.