EDAC, sb_edac: mark expected switch fall-through
Subsystems (2)
PATCH 1/1 EDAC, sb_edac: mark expected switch fall-through
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
---
This code was tested by compilation only (GCC 7.2.0 was used). Please, verify if the actual intention of the code is to fall through.
drivers/edac/sb_edac.c | 1 + 1 file changed, 1 insertion(+)
drivers/edac/sb_edac.c +1 -0
@@ -2485,6 +2485,7 @@ static int ibridge_mci_bind_devs(struct mem_ctl_info *mci,case PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA0_TA :case PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1_TA : pvt->pci_ta = pdev; +/* fall through */ case PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA0_RAS :case PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1_RAS : pvt->pci_ras = pdev;
Hi Silva,
The actual intention of the code is NOT to fall through, though current code can work correctly. Thanks for this finding. If you don't mind, I'll submit a fix patch for it with the tag 'Reported-by:' by you.
Thanks!
- Qiuxu
Quoted 25 lines
From: [email protected] [mailto:linux-edac- [email protected]] On Behalf Of Gustavo A. R. Silva
Sent: Saturday, October 14, 2017 4:28 AM
To: Mauro Carvalho Chehab <[email protected]>; Borislav Petkov <[email protected]>
Cc: [email protected]; [email protected]; Gustavo A. R. Silva <[email protected]>
Subject: [PATCH] EDAC,sb_edac: mark expected switch fall-throughIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Signed-off-by Gustavo A. R. Silva <[email protected]>---
This code was tested by compilation only (GCC 7.2.0 was used). Please, verify if the actual intention of the code is to fall through.drivers/edac/sb_edac.c | 1 + 1 file changed, 1 insertion(+)drivers/edac/sb_edac.c index renamed from drivers/edac/sb_edac.c +0
-072b98a0..b50d714 100644
drivers/edac/sb_edac.c static int ibridge_mci_bind_devs(struct mem_ctl_info · line 2491
Quoted 7 lines
drivers/edac/sb_edac.c +1
-0@@ -2485,6 +2485,7 @@ static int ibridge_mci_bind_devs(struct mem_ctl_info *mci, case PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA0_TA:case PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1_TA : pvt->pci_ta = pdev; +/* fall through */ case PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA0_RAS :case PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1_RAS :
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Borislav Petkov
maintainerQuoted 4 lines · Qiuxu
Hi Silva,
The actual intention of the code is NOT to fall through, though current code can work correctly. Thanks for this finding. If you don't mind, I'll submit a fix patch for it with the tag 'Reported-by:' by you.
I'd prefer if Gustavo would submit a patch fixing that, as he caught it and I'd prefer if you don't top-post on public mailing lists please.
Thanks.
Quoting Borislav Petkov <[email protected]>:
Quoted 11 lines · Qiuxu
Quoted 6 lines
Hi Silva,
The actual intention of the code is NOT to fall through, though
current code can work correctly.
Thanks for this finding. If you don't mind, I'll submit a fix
patch for it with the tag 'Reported-by:' by you.I'd prefer if Gustavo would submit a patch fixing that, as he caught it and I'd prefer if you don't top-post on public mailing lists please.
I can do that. I will send a patch shortly.
Thanks
---
Gustavo A. R. Silva
--
To unsubscribe from this list: send the line "unsubscribe linux-edac" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/1 EDAC, sb_edac: fix missing break in switch
Add missing break statement in order to prevent the code from falling through.
--- drivers/edac/sb_edac.c | 1 + 1 file changed, 1 insertion(+)
drivers/edac/sb_edac.c +1 -0
@@ -2485,6 +2485,7 @@ static int ibridge_mci_bind_devs(struct mem_ctl_info *mci,case PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA0_TA :case PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1_TA : pvt->pci_ta = pdev; +break ;case PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA0_RAS :case PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1_RAS : pvt->pci_ras = pdev;
Re: [PATCH] EDAC, sb_edac: fix missing break in switch
Quoted 14 lines · Gustavo A. R. Silva
Add missing break statement in order to prevent the code from falling through.
Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/edac/sb_edac.c | 1 + 1 file changed, 1 insertion(+)drivers/edac/sb_edac.c +0
-0
drivers/edac/sb_edac.c static int ibridge_mci_bind_devs(struct mem_ctl_info *mci, · line 2491
Quoted 7 lines
drivers/edac/sb_edac.c +1
-0@@ -2485,6 +2485,7 @@ static int ibridge_mci_bind_devs(struct mem_ctl_info *mci,case PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA0_TA :case PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1_TA : pvt->pci_ta = pdev; +break ;case PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA0_RAS :case PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1_RAS : pvt->pci_ras = pdev;
Applied, thanks.