All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipmi: kcs_bmc: mark expected switch fall-through in kcs_bmc_handle_data
@ 2018-02-14 17:30 Gustavo A. R. Silva
  2018-02-14 21:46 ` Corey Minyard
  0 siblings, 1 reply; 4+ messages in thread
From: Gustavo A. R. Silva @ 2018-02-14 17:30 UTC (permalink / raw)
  To: Corey Minyard, Arnd Bergmann, Greg Kroah-Hartman
  Cc: openipmi-developer, linux-kernel, Gustavo A. R. Silva

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

Addresses-Coverity-ID: 1465255 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
This code was compiled with GCC 7.3.0

 drivers/char/ipmi/kcs_bmc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/ipmi/kcs_bmc.c b/drivers/char/ipmi/kcs_bmc.c
index 3a3498a..6476bfb 100644
--- a/drivers/char/ipmi/kcs_bmc.c
+++ b/drivers/char/ipmi/kcs_bmc.c
@@ -95,6 +95,7 @@ static void kcs_bmc_handle_data(struct kcs_bmc *kcs_bmc)
 	switch (kcs_bmc->phase) {
 	case KCS_PHASE_WRITE_START:
 		kcs_bmc->phase = KCS_PHASE_WRITE_DATA;
+		/* fall through */
 
 	case KCS_PHASE_WRITE_DATA:
 		if (kcs_bmc->data_in_idx < KCS_MSG_BUFSIZ) {
-- 
2.7.4

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

* Re: [PATCH] ipmi: kcs_bmc: mark expected switch fall-through in kcs_bmc_handle_data
  2018-02-14 17:30 [PATCH] ipmi: kcs_bmc: mark expected switch fall-through in kcs_bmc_handle_data Gustavo A. R. Silva
@ 2018-02-14 21:46 ` Corey Minyard
  2018-02-14 22:04   ` Gustavo A. R. Silva
  2018-02-16  8:27   ` Wang, Haiyue
  0 siblings, 2 replies; 4+ messages in thread
From: Corey Minyard @ 2018-02-14 21:46 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Arnd Bergmann, Greg Kroah-Hartman
  Cc: openipmi-developer, linux-kernel, Haiyue Wang

On 02/14/2018 11:30 AM, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.

Thanks, queued for next release.

-corey

> Addresses-Coverity-ID: 1465255 ("Missing break in switch")
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
> This code was compiled with GCC 7.3.0
>
>   drivers/char/ipmi/kcs_bmc.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/char/ipmi/kcs_bmc.c b/drivers/char/ipmi/kcs_bmc.c
> index 3a3498a..6476bfb 100644
> --- a/drivers/char/ipmi/kcs_bmc.c
> +++ b/drivers/char/ipmi/kcs_bmc.c
> @@ -95,6 +95,7 @@ static void kcs_bmc_handle_data(struct kcs_bmc *kcs_bmc)
>   	switch (kcs_bmc->phase) {
>   	case KCS_PHASE_WRITE_START:
>   		kcs_bmc->phase = KCS_PHASE_WRITE_DATA;
> +		/* fall through */
>   
>   	case KCS_PHASE_WRITE_DATA:
>   		if (kcs_bmc->data_in_idx < KCS_MSG_BUFSIZ) {

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

* Re: [PATCH] ipmi: kcs_bmc: mark expected switch fall-through in kcs_bmc_handle_data
  2018-02-14 21:46 ` Corey Minyard
@ 2018-02-14 22:04   ` Gustavo A. R. Silva
  2018-02-16  8:27   ` Wang, Haiyue
  1 sibling, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2018-02-14 22:04 UTC (permalink / raw)
  To: minyard, Arnd Bergmann, Greg Kroah-Hartman
  Cc: openipmi-developer, linux-kernel, Haiyue Wang



On 02/14/2018 03:46 PM, Corey Minyard wrote:
> On 02/14/2018 11:30 AM, Gustavo A. R. Silva wrote:
>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
>> where we are expecting to fall through.
> 
> Thanks, queued for next release.
> 

Thanks, Corey.
--
Gustavo

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

* Re: [PATCH] ipmi: kcs_bmc: mark expected switch fall-through in kcs_bmc_handle_data
  2018-02-14 21:46 ` Corey Minyard
  2018-02-14 22:04   ` Gustavo A. R. Silva
@ 2018-02-16  8:27   ` Wang, Haiyue
  1 sibling, 0 replies; 4+ messages in thread
From: Wang, Haiyue @ 2018-02-16  8:27 UTC (permalink / raw)
  To: minyard, Gustavo A. R. Silva, Arnd Bergmann, Greg Kroah-Hartman
  Cc: openipmi-developer, linux-kernel



On 2018-02-15 05:46, Corey Minyard wrote:
> On 02/14/2018 11:30 AM, Gustavo A. R. Silva wrote:
>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
>> where we are expecting to fall through.
>
> Thanks, queued for next release.
>
> -corey
>
>> Addresses-Coverity-ID: 1465255 ("Missing break in switch")
>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
>> ---
>> This code was compiled with GCC 7.3.0
>>
>>   drivers/char/ipmi/kcs_bmc.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/char/ipmi/kcs_bmc.c b/drivers/char/ipmi/kcs_bmc.c
>> index 3a3498a..6476bfb 100644
>> --- a/drivers/char/ipmi/kcs_bmc.c
>> +++ b/drivers/char/ipmi/kcs_bmc.c
>> @@ -95,6 +95,7 @@ static void kcs_bmc_handle_data(struct kcs_bmc 
>> *kcs_bmc)
>>       switch (kcs_bmc->phase) {
>>       case KCS_PHASE_WRITE_START:
>>           kcs_bmc->phase = KCS_PHASE_WRITE_DATA;
>> +        /* fall through */
Thanks, Gustavo. I see many modules have '/* fall through */', but I 
thought it was a just C comment, I didn't
add it for making code clean. Learned it, thank you! :-)
>>         case KCS_PHASE_WRITE_DATA:
>>           if (kcs_bmc->data_in_idx < KCS_MSG_BUFSIZ) {
>
>

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

end of thread, other threads:[~2018-02-16  8:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-14 17:30 [PATCH] ipmi: kcs_bmc: mark expected switch fall-through in kcs_bmc_handle_data Gustavo A. R. Silva
2018-02-14 21:46 ` Corey Minyard
2018-02-14 22:04   ` Gustavo A. R. Silva
2018-02-16  8:27   ` Wang, Haiyue

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.