xfs: remove redundant variable assignment in xfs_symlink()
diff mbox series

Message ID 1585479815-13459-1-git-send-email-kaixuxia@tencent.com
State Accepted
Headers show
Series
  • xfs: remove redundant variable assignment in xfs_symlink()
Related show

Commit Message

kaixuxia March 29, 2020, 11:03 a.m. UTC
From: Kaixu Xia <kaixuxia@tencent.com>

The variables 'udqp' and 'gdqp' have been initialized, so remove
redundant variable assignment in xfs_symlink().

Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
 fs/xfs/xfs_symlink.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Dave Chinner March 29, 2020, 11:03 p.m. UTC | #1
On Sun, Mar 29, 2020 at 07:03:35PM +0800, xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
> 
> The variables 'udqp' and 'gdqp' have been initialized, so remove
> redundant variable assignment in xfs_symlink().
> 
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
> ---
>  fs/xfs/xfs_symlink.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
> index d762d42..3ad82c3 100644
> --- a/fs/xfs/xfs_symlink.c
> +++ b/fs/xfs/xfs_symlink.c
> @@ -176,7 +176,6 @@
>  		return -ENAMETOOLONG;
>  	ASSERT(pathlen > 0);
>  
> -	udqp = gdqp = NULL;
>  	prid = xfs_get_initial_prid(dp);

Looks fine.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Chaitanya Kulkarni March 30, 2020, 6:37 p.m. UTC | #2
On 03/29/2020 04:03 AM, xiakaixu1987@gmail.com wrote:
> ---
>   fs/xfs/xfs_symlink.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
> index d762d42..3ad82c3 100644
> --- a/fs/xfs/xfs_symlink.c
> +++ b/fs/xfs/xfs_symlink.c
> @@ -176,7 +176,6 @@
>   		return -ENAMETOOLONG;
>   	ASSERT(pathlen > 0);
>
> -	udqp = gdqp = NULL;
>   	prid = xfs_get_initial_prid(dp);
>
>   	/*
> -- 1.8.3.1

Since these two variables are initialized at the time of declaration
it make sense to remove this. Looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

Patch
diff mbox series

diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
index d762d42..3ad82c3 100644
--- a/fs/xfs/xfs_symlink.c
+++ b/fs/xfs/xfs_symlink.c
@@ -176,7 +176,6 @@ 
 		return -ENAMETOOLONG;
 	ASSERT(pathlen > 0);
 
-	udqp = gdqp = NULL;
 	prid = xfs_get_initial_prid(dp);
 
 	/*