lkml.org 
[lkml]   [2021]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 2/3] fs/efs: Correct spacing after C keywords
From
Date
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.


\
 
 \ /
  Last update: 2021-02-05 07:10    [W:0.169 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site