mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Amy Parker <enbyamy@gmail.com>, linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] fs/efs: Correct spacing after C keywords
Date: Thu, 04 Feb 2021 22:07:52 -0800	[thread overview]
Message-ID: <1055f62a90a03d6f9c8092d17b7a03c0dd3cbc69.camel@perches.com> (raw)
In-Reply-To: <20210205051429.553657-3-enbyamy@gmail.com>

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.



  reply	other threads:[~2021-02-05  6:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05  5:14 [PATCH v2 0/3] fs/efs: Follow kernel style guide Amy Parker
2021-02-05  5:14 ` [PATCH v2 1/3] fs/efs: Use correct brace styling for statements Amy Parker
2021-02-05  6:00   ` Joe Perches
2021-02-05  5:14 ` [PATCH v2 2/3] fs/efs: Correct spacing after C keywords Amy Parker
2021-02-05  6:07   ` Joe Perches [this message]
2021-02-05  5:14 ` [PATCH v2 3/3] fs/efs: Fix line breakage for " Amy Parker

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=1055f62a90a03d6f9c8092d17b7a03c0dd3cbc69.camel@perches.com \
    --to=joe@perches.com \
    --cc=enbyamy@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®