On Wed, Aug 14, 2019 at 7:36 PM Joe Perches <j...@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 <j...@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

Reply via email to