Re: [PATCH v2 2/3] fs/efs: Correct spacing after C keywords

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux