2021-06-04 02:37:24

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH][next] scsi: mpi3mr: Fix fall-through warning for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix a
fall-through warning by explicitly adding a break statement 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 <[email protected]>
---
JFYI: We had thousands of these sorts of warnings and now we are down
to just 22 in linux-next. This is one of those last remaining
warnings.

drivers/scsi/mpi3mr/mpi3mr_os.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index a54aa009ec5a..4ab0609a1b94 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -1732,6 +1732,7 @@ static void mpi3mr_sastopochg_evt_th(struct mpi3mr_ioc *mrioc,
atomic_dec_if_positive
(&scsi_tgt_priv_data->block_io);
}
+ break;
case MPI3_EVENT_SAS_TOPO_PHY_RC_PHY_CHANGED:
default:
break;
--
2.27.0


2021-06-04 18:26:28

by Kees Cook

[permalink] [raw]
Subject: Re: [PATCH][next] scsi: mpi3mr: Fix fall-through warning for Clang

On Thu, Jun 03, 2021 at 09:35:30PM -0500, Gustavo A. R. Silva wrote:
> In preparation to enable -Wimplicit-fallthrough for Clang, fix a
> fall-through warning by explicitly adding a break statement 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 <[email protected]>

Looks right.

Reviewed-by: Kees Cook <[email protected]>

--
Kees Cook

2021-06-08 02:27:53

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH][next] scsi: mpi3mr: Fix fall-through warning for Clang


Gustavo,

> In preparation to enable -Wimplicit-fallthrough for Clang, fix a
> fall-through warning by explicitly adding a break statement instead
> of just letting the code fall through to the next case.

Applied to 5.14/scsi-staging, thanks!

--
Martin K. Petersen Oracle Linux Engineering

2021-06-16 03:51:20

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH][next] scsi: mpi3mr: Fix fall-through warning for Clang

On Thu, 3 Jun 2021 21:35:30 -0500, Gustavo A. R. Silva wrote:

> In preparation to enable -Wimplicit-fallthrough for Clang, fix a
> fall-through warning by explicitly adding a break statement instead
> of just letting the code fall through to the next case.

Applied to 5.14/scsi-queue, thanks!

[1/1] scsi: mpi3mr: Fix fall-through warning for Clang
https://git.kernel.org/mkp/scsi/c/7b8a49881b01

--
Martin K. Petersen Oracle Linux Engineering