Skip to contentSkip to conversation

scsi: mpt3sas: Fix fall-through warnings for Clang

PATCH Applied Gustavo A. R. Silva 4 participants 5 messages May 28, 2021 – Jun 8, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
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(+)
drivers/scsi/mpt3sas/mpt3sas_base.c +1 -0
index 68fde055b02f..969c0d676ae2 100644
@@ -4435,6 +4435,7 @@ _base_display_OEMs_branding(struct MPT3SAS_ADAPTER *ioc)
 				 ioc->pdev->subsystem_device);
 			break;
 		}
+		break;
 	default:
 		break;
 	}
drivers/scsi/mpt3sas/mpt3sas_scsih.c +1 -0
index d00aca3c77ce..d9d5e9c0e110 100644
@@ -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;
 		}
Signature · 1 line
2.27.0
#2 lore raw
In reply to Gustavo A. R. Silva

Gustavo,

Quoted 3 lines

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!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#3 lore raw
Quoted 1 line · Martin K. Petersen

Applied to 5.14/scsi-staging, thanks!

Thanks, Martin.
--
Gustavo

#4 lore raw
In reply to Gustavo A. R. Silva
Quoted 3 lines · Gustavo A. R. Silva

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
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering