From: "Darrick J. Wong" <djwong@kernel.org>
To: Zeng Heng <zengheng4@huawei.com>
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] xfs: remove redundant else for clean code
Date: Tue, 23 Aug 2022 07:26:36 -0700 [thread overview]
Message-ID: <YwTjnM/vvzTKLQWk@magnolia> (raw)
In-Reply-To: <20220823014745.4156948-1-zengheng4@huawei.com>
On Tue, Aug 23, 2022 at 09:47:45AM +0800, Zeng Heng wrote:
> "else" is not generally useful after a return, so remove it for clean code.
>
> There is no logical changes.
>
> Signed-off-by: Zeng Heng <zengheng4@huawei.com>
> ---
> fs/xfs/xfs_log.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> index 386b0307aed8..f6e7e4fd72ae 100644
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -226,12 +226,12 @@ xlog_ticket_reservation(
> if (head == &log->l_write_head) {
> ASSERT(tic->t_flags & XLOG_TIC_PERM_RESERV);
> return tic->t_unit_res;
> - } else {
> - if (tic->t_flags & XLOG_TIC_PERM_RESERV)
> - return tic->t_unit_res * tic->t_cnt;
> - else
> - return tic->t_unit_res;
> }
> +
> + if (tic->t_flags & XLOG_TIC_PERM_RESERV)
> + return tic->t_unit_res * tic->t_cnt;
> +
> + return tic->t_unit_res;
I think this looks correct
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> }
>
> STATIC bool
> --
> 2.25.1
>
prev parent reply other threads:[~2022-08-23 16:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-23 1:47 Zeng Heng
2022-08-23 14:26 ` Darrick J. Wong [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=YwTjnM/vvzTKLQWk@magnolia \
--to=djwong@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=zengheng4@huawei.com \
/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
all inboxes | Powered by JetHome®