Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1396515

Re: [PATCH] md: make the code more readable in the for-loop

From Shaohua Li <shli@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] md: make the code more readable in the for-loop
Date 2016-05-09 01:10 +0200
Message-ID <rwFZL-82O-1@gated-at.bofh.it> (permalink)
References <rwwWu-7Qm-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] md: make the code more readable in the for-loop "Tiezhu Yang" <kernelpatch@126.com> - 2016-05-08 15:30 +0200
  Re: [PATCH] md: make the code more readable in the for-loop Shaohua Li <shli@kernel.org> - 2016-05-09 01:10 +0200

csiph-web