[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1055f62a90a03d6f9c8092d17b7a03c0dd3cbc69.camel@perches.com>
Date:   Thu, 04 Feb 2021 22:07:52 -0800
From:   Joe Perches <joe@...ches.com>
To:     Amy Parker <enbyamy@...il.com>, linux-fsdevel@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/3] fs/efs: Correct spacing after C keywords
On Thu, 2021-02-04 at 21:14 -0800, Amy Parker wrote:
> In EFS code, some C keywords (most commonly 'for') do not have spaces 
> before their instructions, such as for() vs for (). The kernel style 
> guide indicates that these should be of the latter variant. This patch 
> updates them accordingly.
ok but:
> diff --git a/fs/efs/super.c b/fs/efs/super.c
[]
> @@ -169,7 +169,7 @@ static efs_block_t efs_validate_vh(struct volume_header *vh) {
>  		return 0;
>  
> 
>  	ui = ((__be32 *) (vh + 1)) - 1;
> -	for(csum = 0; ui >= ((__be32 *) vh);) {
> +	for (csum = 0; ui >= ((__be32 *) vh);) {
>  		cs = *ui--;
>  		csum += be32_to_cpu(cs);
>  	}
I think this loop is atypical.  More common would be:
	csum = 0;
	for (ui = ((__be32 *)(vh + 1)) - 1; ui >= (__be32 *)vh; ui--)
		csum += be32_to_cpu(*ui);
> @@ -198,9 +198,9 @@ static efs_block_t efs_validate_vh(struct volume_header *vh) {
>  	}
>  #endif
>  
> 
> -	for(i = 0; i < NPARTAB; i++) {
> +	for (i = 0; i < NPARTAB; i++) {
>  		pt_type = (int) be32_to_cpu(vh->vh_pt[i].pt_type);
> -		for(pt_entry = sgi_pt_types; pt_entry->pt_name; pt_entry++) {
> +		for (pt_entry = sgi_pt_types; pt_entry->pt_name; pt_entry++) {
>  			if (pt_type == pt_entry->pt_type) break;
Also atypical is the break location, it should be on a separate line.
Powered by blists - more mailing lists
 
