From: Shaohua Li <shli@kernel.org>
To: Tiezhu Yang <kernelpatch@126.com>
Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] md: make the code more readable in the for-loop
Date: Sun, 8 May 2016 16:03:17 -0700 [thread overview]
Message-ID: <20160508230317.GB8100@kernel.org> (raw)
In-Reply-To: <318e71b0.3d4e.1549071292b.Coremail.kernelpatch@126.com>
On Sun, May 08, 2016 at 08:56:55PM +0800, Tiezhu Yang wrote:
> This patch modifies raid1.c, raid10.c and raid5.c
> to make the code more readable in the for-loop
> and also fixes the scripts/checkpatch.pl error:
> ERROR: trailing statements should be on next line.
>
> Signed-off-by: Tiezhu Yang <kernelpatch@126.com>
> @@ -3573,7 +3573,8 @@ static void handle_stripe_dirtying(struct r5conf *conf,
> pr_debug("force RCW rmw_level=%u, recovery_cp=%llu sh->sector=%llu\n",
> conf->rmw_level, (unsigned long long)recovery_cp,
> (unsigned long long)sh->sector);
> - } else for (i = disks; i--; ) {
> + } else
> + for (i = disks - 1; i >= 0; i--) {
> /* would I have to read this buffer for read_modify_write */
> struct r5dev *dev = &sh->dev[i];
> if ((dev->towrite || i == sh->pd_idx || i == sh->qd_idx) &&
Applied. I move the for statement to be in a {} of else statement.
next prev parent reply other threads:[~2016-05-08 23:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-08 12:56 [PATCH] md: make the code more readable in the for-loop Tiezhu Yang
2016-05-08 23:03 ` Shaohua Li [this message]
2016-05-08 23:33 ` Eyal Lebedinsky
2016-05-09 3:53 ` Shaohua Li
2016-05-09 6:31 ` NeilBrown
2016-05-09 20:45 ` Jes Sorensen
2016-05-11 0:29 ` Shaohua Li
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=20160508230317.GB8100@kernel.org \
--to=shli@kernel.org \
--cc=kernelpatch@126.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@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 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.