LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Joe Perches <joe@perches.com>
Cc: David Howells <dhowells@redhat.com>,
	Nathan Chancellor <natechancellor@gmail.com>,
	Nathan Huckleberry <nhuck@google.com>,
	linux-afs@lists.infradead.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] afs: Move comments after /* fallthrough */
Date: Thu, 15 Aug 2019 15:34:57 -0700
Message-ID: <CAKwvOdmuReaFgFK+=aib6rRfAb_GTGubLyJ3sAH-tnkKYHASqQ@mail.gmail.com> (raw)
In-Reply-To: <e77b0f32a2ce97c872eede52c88b84aa78094ae5.1565836130.git.joe@perches.com>

On Wed, Aug 14, 2019 at 7:36 PM Joe Perches <joe@perches.com> wrote:
>
> Make the code a bit easier for a script to appropriately convert
> case statement blocks with /* fallthrough */ comments to a macro by
> moving comments describing the next case block to the case statement.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  fs/afs/cmservice.c | 10 +++-------
>  fs/afs/fsclient.c  | 51 +++++++++++++++++----------------------------------
>  fs/afs/vlclient.c  | 50 +++++++++++++++++++++++++-------------------------
>  fs/afs/yfsclient.c | 51 +++++++++++++++++----------------------------------

So these changes are across just fs/afs, how many patches like this
would you need across the whole tree to solve this problem?

>  4 files changed, 62 insertions(+), 100 deletions(-)
>
> diff --git a/fs/afs/cmservice.c b/fs/afs/cmservice.c
> index b86195e4dc6c..2270fe9325da 100644
> --- a/fs/afs/cmservice.c
> +++ b/fs/afs/cmservice.c
> @@ -282,10 +282,8 @@ static int afs_deliver_cb_callback(struct afs_call *call)
>         case 0:
>                 afs_extract_to_tmp(call);
>                 call->unmarshall++;
> -
> -               /* extract the FID array and its count in two steps */
>                 /* fall through */
> -       case 1:
> +       case 1:         /* extract the FID array and its count in two steps */

Could these instead be on their own line as the first line within this
case?  (I don't feel particularly strongly about this).

...

> @@ -220,8 +220,8 @@ static int afs_deliver_vl_get_addrs_u(struct afs_call *call)
>                 count = min(call->count, 4U);
>                 afs_extract_to_buf(call, count * sizeof(__be32));
>
> -               /* Fall through - and extract entries */

Yikes! Mixing fall through and other comments...yeah that would be
hard to globally find and replace.

> -       case 2:
> +               /* Fall through */
> +       case 2:         /* extract entries */
>                 ret = afs_extract_data(call, call->count > 4);
>                 if (ret < 0)
>                         return ret;


-- 
Thanks,
~Nick Desaulniers

  parent reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-15  2:36 Joe Perches
2019-08-15 13:40 ` David Howells
2019-08-15 23:46   ` Joe Perches
2019-08-16 10:36   ` David Howells
2019-08-16 11:07     ` Joe Perches
2019-08-19 21:03     ` David Howells
2019-08-19 21:50       ` Joe Perches
2019-08-15 22:34 ` Nick Desaulniers [this message]
2019-08-15 22:55   ` Joe Perches

Reply instructions:

You may reply publically 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='CAKwvOdmuReaFgFK+=aib6rRfAb_GTGubLyJ3sAH-tnkKYHASqQ@mail.gmail.com' \
    --to=ndesaulniers@google.com \
    --cc=dhowells@redhat.com \
    --cc=joe@perches.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=nhuck@google.com \
    /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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox