linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Chengguang Xu <cgxu519@gmx.com>
Cc: jack@suse.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] quota: remvoe redundant variable assignment
Date: Mon, 15 Apr 2019 11:50:34 +0200	[thread overview]
Message-ID: <20190415095033.GB13684@quack2.suse.cz> (raw)
In-Reply-To: <20190414135855.2536-1-cgxu519@gmx.com>

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@gmx.com>

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@suse.com>
SUSE Labs, CR

      reply	other threads:[~2019-04-15  9:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-14 13:58 [PATCH] quota: remvoe redundant variable assignment Chengguang Xu
2019-04-15  9:50 ` Jan Kara [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190415095033.GB13684@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=cgxu519@gmx.com \
    --cc=jack@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).