[lustre-devel] [PATCH 19/20] staging: lustre: ptlrpc: mark expected switch fall-throughs

Dilger, Andreas andreas.dilger at intel.com
Tue Oct 17 16:04:00 PDT 2017


On Oct 12, 2017, at 10:17, Gustavo A. R. Silva <garsilva at embeddedor.com> wrote:
> 
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva at embeddedor.com>

Reviewed-by: Andreas Dilger <andreas.dilger at intel.com>

> ---
> drivers/staging/lustre/lustre/ptlrpc/pack_generic.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
> index aad4ff1..a3664c1 100644
> --- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
> +++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
> @@ -786,7 +786,7 @@ __u32 lustre_msg_get_flags(struct lustre_msg *msg)
> 
> 		CERROR("invalid msg %p: no ptlrpc body!\n", msg);
> 	}
> -	/* no break */
> +	/* fall through */
> 	default:
> 		/* flags might be printed in debug code while message
> 		 * uninitialized
> @@ -854,7 +854,7 @@ __u32 lustre_msg_get_op_flags(struct lustre_msg *msg)
> 
> 		CERROR("invalid msg %p: no ptlrpc body!\n", msg);
> 	}
> -	/* no break */
> +	/* fall through */
> 	default:
> 		return 0;
> 	}
> @@ -1035,7 +1035,7 @@ int lustre_msg_get_status(struct lustre_msg *msg)
> 
> 		CERROR("invalid msg %p: no ptlrpc body!\n", msg);
> 	}
> -	/* no break */
> +	/* fall through */
> 	default:
> 		/* status might be printed in debug code while message
> 		 * uninitialized
> -- 
> 2.7.4
> 

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation









More information about the lustre-devel mailing list