Re: [PATCH] quota: remvoe redundant variable assignment

From: Jan Kara
Date: Mon Apr 15 2019 - 05:50:37 EST


On Sun 14-04-19 21:58:55, Chengguang Xu wrote:
> The assignment of variable ret is redundant because the
> value of ret is 0 after calling v2_read_header() in normal
> case.
>
> Signed-off-by: Chengguang Xu <cgxu519@xxxxxxx>

Thanks for the patch. Yes, you are correct the assignment is redundant but
this way it is more obvious what we're going to return and there are also
less chances we'll break the logic when adding some code using 'ret' in the
middle of v2_read_file_info().

Honza

> ---
> fs/quota/quota_v2.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c
> index a73e5b34db41..25d36607be6e 100644
> --- a/fs/quota/quota_v2.c
> +++ b/fs/quota/quota_v2.c
> @@ -158,7 +158,6 @@ static int v2_read_file_info(struct super_block *sb, int type)
> qinfo->dqi_entry_size = sizeof(struct v2r1_disk_dqblk);
> qinfo->dqi_ops = &v2r1_qtree_ops;
> }
> - ret = 0;
> out:
> up_read(&dqopt->dqio_sem);
> return ret;
> --
> 2.17.2
>
>
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR