diff mbox series

[003/141] cifs: Fix fall-through warnings for Clang

Message ID 8a35ff7132f95e24f6d9501e1bec644854fc5078.1605896059.git.gustavoars@kernel.org (mailing list archive)
State New, archived
Headers show
Series Fix fall-through warnings for Clang | expand

Commit Message

Gustavo A. R. Silva Nov. 20, 2020, 6:24 p.m. UTC
In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
warnings by explicitly adding multiple break/goto statements instead of
just letting the code fall through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 fs/cifs/inode.c     | 1 +
 fs/cifs/sess.c      | 1 +
 fs/cifs/smbdirect.c | 1 +
 3 files changed, 3 insertions(+)

Comments

Steve French Dec. 8, 2020, 8:42 p.m. UTC | #1
Merged into cifs-2.6.git for-next

Let me know if you see any other cleanup/misc cifs.ko patches that may
have gotten missed ...

On Fri, Nov 20, 2020 at 12:25 PM Gustavo A. R. Silva
<gustavoars@kernel.org> wrote:
>
> In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
> warnings by explicitly adding multiple break/goto statements instead of
> just letting the code fall through to the next case.
>
> Link: https://github.com/KSPP/linux/issues/115
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
>  fs/cifs/inode.c     | 1 +
>  fs/cifs/sess.c      | 1 +
>  fs/cifs/smbdirect.c | 1 +
>  3 files changed, 3 insertions(+)
>
> diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
> index 9ee5f304592f..ac01f9684b39 100644
> --- a/fs/cifs/inode.c
> +++ b/fs/cifs/inode.c
> @@ -771,6 +771,7 @@ cifs_get_file_info(struct file *filp)
>                  */
>                 rc = 0;
>                 CIFS_I(inode)->time = 0;
> +               goto cgfi_exit;
>         default:
>                 goto cgfi_exit;
>         }
> diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
> index de564368a887..6c2c42f8d893 100644
> --- a/fs/cifs/sess.c
> +++ b/fs/cifs/sess.c
> @@ -812,6 +812,7 @@ cifs_select_sectype(struct TCP_Server_Info *server, enum securityEnum requested)
>                                 return NTLMv2;
>                         if (global_secflags & CIFSSEC_MAY_NTLM)
>                                 return NTLM;
> +                       break;
>                 default:
>                         break;
>                 }
> diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c
> index b029ed31ef91..10dfe5006792 100644
> --- a/fs/cifs/smbdirect.c
> +++ b/fs/cifs/smbdirect.c
> @@ -246,6 +246,7 @@ smbd_qp_async_error_upcall(struct ib_event *event, void *context)
>         case IB_EVENT_CQ_ERR:
>         case IB_EVENT_QP_FATAL:
>                 smbd_disconnect_rdma_connection(info);
> +               break;
>
>         default:
>                 break;
> --
> 2.27.0
>
diff mbox series

Patch

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 9ee5f304592f..ac01f9684b39 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -771,6 +771,7 @@  cifs_get_file_info(struct file *filp)
 		 */
 		rc = 0;
 		CIFS_I(inode)->time = 0;
+		goto cgfi_exit;
 	default:
 		goto cgfi_exit;
 	}
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index de564368a887..6c2c42f8d893 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -812,6 +812,7 @@  cifs_select_sectype(struct TCP_Server_Info *server, enum securityEnum requested)
 				return NTLMv2;
 			if (global_secflags & CIFSSEC_MAY_NTLM)
 				return NTLM;
+			break;
 		default:
 			break;
 		}
diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c
index b029ed31ef91..10dfe5006792 100644
--- a/fs/cifs/smbdirect.c
+++ b/fs/cifs/smbdirect.c
@@ -246,6 +246,7 @@  smbd_qp_async_error_upcall(struct ib_event *event, void *context)
 	case IB_EVENT_CQ_ERR:
 	case IB_EVENT_QP_FATAL:
 		smbd_disconnect_rdma_connection(info);
+		break;
 
 	default:
 		break;