public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] EDAC, sb_edac: mark expected switch fall-through
@ 2017-10-13 20:28 Gustavo A. R. Silva
  2017-10-16  3:00 ` Zhuo, Qiuxu
  0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-13 20:28 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Borislav Petkov
  Cc: linux-edac, linux-kernel, Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
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(+)

diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index 72b98a0..b50d714 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: [PATCH] EDAC, sb_edac: mark expected switch fall-through
  2017-10-13 20:28 [PATCH] EDAC, sb_edac: mark expected switch fall-through Gustavo A. R. Silva
@ 2017-10-16  3:00 ` Zhuo, Qiuxu
  2017-10-16 10:23   ` Borislav Petkov
  0 siblings, 1 reply; 6+ messages in thread
From: Zhuo, Qiuxu @ 2017-10-16  3:00 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Mauro Carvalho Chehab, Borislav Petkov
  Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org

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

> From: linux-edac-owner@vger.kernel.org [mailto:linux-edac-
> owner@vger.kernel.org] On Behalf Of Gustavo A. R. Silva
> Sent: Saturday, October 14, 2017 4:28 AM
> To: Mauro Carvalho Chehab <mchehab@kernel.org>; Borislav Petkov
> <bp@alien8.de>
> Cc: linux-edac@vger.kernel.org; linux-kernel@vger.kernel.org; Gustavo A. R.
> Silva <garsilva@embeddedor.com>
> Subject: [PATCH] EDAC, sb_edac: mark expected switch fall-through
> 
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we
> are expecting to fall through.
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
> 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(+)
> 
> diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c index
> 72b98a0..b50d714 100644
> --- a/drivers/edac/sb_edac.c
> +++ b/drivers/edac/sb_edac.c
> @@ -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:

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] EDAC, sb_edac: mark expected switch fall-through
  2017-10-16  3:00 ` Zhuo, Qiuxu
@ 2017-10-16 10:23   ` Borislav Petkov
  2017-10-16 16:50     ` Gustavo A. R. Silva
  0 siblings, 1 reply; 6+ messages in thread
From: Borislav Petkov @ 2017-10-16 10:23 UTC (permalink / raw)
  To: Zhuo, Qiuxu
  Cc: Gustavo A. R. Silva, Mauro Carvalho Chehab,
	linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org

On Mon, Oct 16, 2017 at 03:00:53AM +0000, Zhuo, Qiuxu wrote:
> 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.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] EDAC, sb_edac: mark expected switch fall-through
  2017-10-16 10:23   ` Borislav Petkov
@ 2017-10-16 16:50     ` Gustavo A. R. Silva
  2017-10-16 17:40       ` [PATCH] EDAC, sb_edac: fix missing break in switch Gustavo A. R. Silva
  0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-16 16:50 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Zhuo, Qiuxu, Mauro Carvalho Chehab, linux-edac, linux-kernel


Quoting Borislav Petkov <bp@alien8.de>:

> On Mon, Oct 16, 2017 at 03:00:53AM +0000, Zhuo, Qiuxu wrote:
>> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] EDAC, sb_edac: fix missing break in switch
  2017-10-16 16:50     ` Gustavo A. R. Silva
@ 2017-10-16 17:40       ` Gustavo A. R. Silva
  2017-10-19  8:57         ` Borislav Petkov
  0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-16 17:40 UTC (permalink / raw)
  To: Borislav Petkov, Mauro Carvalho Chehab, Qiuxu Zhuo
  Cc: linux-edac, linux-kernel, Gustavo A. R. Silva

Add missing break statement in order to prevent the code from falling
through.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/edac/sb_edac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index 72b98a0..f34430f 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] EDAC, sb_edac: fix missing break in switch
  2017-10-16 17:40       ` [PATCH] EDAC, sb_edac: fix missing break in switch Gustavo A. R. Silva
@ 2017-10-19  8:57         ` Borislav Petkov
  0 siblings, 0 replies; 6+ messages in thread
From: Borislav Petkov @ 2017-10-19  8:57 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Mauro Carvalho Chehab, Qiuxu Zhuo, linux-edac, linux-kernel

On Mon, Oct 16, 2017 at 12:40:29PM -0500, Gustavo A. R. Silva wrote:
> Add missing break statement in order to prevent the code from falling
> through.
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
>  drivers/edac/sb_edac.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
> index 72b98a0..f34430f 100644
> --- a/drivers/edac/sb_edac.c
> +++ b/drivers/edac/sb_edac.c
> @@ -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.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-19  8:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-13 20:28 [PATCH] EDAC, sb_edac: mark expected switch fall-through Gustavo A. R. Silva
2017-10-16  3:00 ` Zhuo, Qiuxu
2017-10-16 10:23   ` Borislav Petkov
2017-10-16 16:50     ` Gustavo A. R. Silva
2017-10-16 17:40       ` [PATCH] EDAC, sb_edac: fix missing break in switch Gustavo A. R. Silva
2017-10-19  8:57         ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox