2021-05-28 20:10:41

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH][next] scsi: mpt3sas: Fix fall-through warnings for Clang

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

drivers/scsi/mpt3sas/mpt3sas_base.c | 1 +
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 1 +
2 files changed, 2 insertions(+)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 68fde055b02f..969c0d676ae2 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -4435,6 +4435,7 @@ _base_display_OEMs_branding(struct MPT3SAS_ADAPTER *ioc)
ioc->pdev->subsystem_device);
break;
}
+ break;
default:
break;
}
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index d00aca3c77ce..d9d5e9c0e110 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -11932,6 +11932,7 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
ioc->multipath_on_hba = 1;
else
ioc->multipath_on_hba = 0;
+ break;
default:
break;
}
--
2.27.0


2021-06-01 19:22:10

by Kees Cook

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

On Fri, May 28, 2021 at 03:08:28PM -0500, Gustavo A. R. Silva wrote:
> In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple
> of warnings by explicitly adding break 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 <[email protected]>

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

--
Kees Cook

2021-06-02 04:16:29

by Gustavo A. R. Silva

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



On 6/1/21 22:23, Martin K. Petersen wrote:

> Applied to 5.14/scsi-staging, thanks!

Thanks, Martin.
--
Gustavo

2021-06-02 06:25:41

by Martin K. Petersen

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


Gustavo,

> In preparation to enable -Wimplicit-fallthrough for Clang, fix a
> couple of warnings by explicitly adding break statements 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-08 03:08:59

by Martin K. Petersen

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

On Fri, 28 May 2021 15:08:28 -0500, Gustavo A. R. Silva wrote:

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

Applied to 5.14/scsi-queue, thanks!

[1/1] scsi: mpt3sas: Fix fall-through warnings for Clang
https://git.kernel.org/mkp/scsi/c/84a84cc6aff4

--
Martin K. Petersen Oracle Linux Engineering