Re: [PATCH] afs: Mark expected switch fall-throughs

From: David Howells
Date: Thu Aug 02 2018 - 12:03:08 EST


Gustavo A. R. Silva <gustavo@xxxxxxxxxxxxxx> wrote:

> + /* Fall through */
> no_msw:
> /* extract the returned data length */
> case 2:

That would appear to be added in the wrong place. The fall-through is after
the no_msw label.

> +
> + /* Fall through */
> no_volname_padding:

Ditto - and several other dittos too.

> - /* Done */
> + /* Fall through - Done */

Yuck.

> +
> + /* fall through */

Capital 'F' for consistency please.

Whilst I understand the argument for explicitly marking the fall-throughs to
catch missing breaks, it's a bit irritating at times. Can we have an
additional annotation that tells the compiler that every case in a switch
statement is going to fall through (so no break before case) except the last?
That would be more useful in this case.

David