ipmi: kcs_bmc: mark expected switch fall-through in kcs_bmc_handle_data
PATCH 1/1 ipmi: kcs_bmc: mark expected switch fall-through in kcs_bmc_handle_data
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 1465255 ("Missing break in switch")
---
This code was compiled with GCC 7.3.0
drivers/char/ipmi/kcs_bmc.c | 1 + 1 file changed, 1 insertion(+)
drivers/char/ipmi/kcs_bmc.c +1 -0
@@ -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 ) {
Signature · 1 line
2.7.4
Quoted 2 lines · Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Thanks, queued for next release.
-corey
Quoted 20 lines
Addresses-Coverity-ID: 1465255 ("Missing break in switch")
Signed-off-by Gustavo A. R. Silva <[email protected]>---
This code was compiled with GCC 7.3.0drivers/char/ipmi/kcs_bmc.c | 1 + 1 file changed, 1 insertion(+)drivers/char/ipmi/kcs_bmc.c +1
-0@@ -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 ) {
Quoted 6 lines · Corey Minyard
Quoted 2 lines · Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Thanks, queued for next release.
Thanks, Corey.
--
Gustavo
Quoted 16 lines · Corey Minyard
Quoted 2 lines · Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Thanks, queued for next release.
-corey
Quoted 8 lines
Addresses-Coverity-ID: 1465255 ("Missing break in switch")
Signed-off-by Gustavo A. R. Silva <[email protected]>---
This code was compiled with GCC 7.3.0
drivers/char/ipmi/kcs_bmc.c| 1 +1 file changed, 1 insertion(+)
Quoted 10 lines
Quoted 10 lines
drivers/char/ipmi/kcs_bmc.c +0
-0@@ -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! :-)
Quoted 4 lines
Quoted 2 lines
case
KCS_PHASE_WRITE_DATA:
if (kcs_bmc->data_in_idx<KCS_MSG_BUFSIZ) {