scsi: mpt3sas: Mark expected switch fall-through [Linux 5.3]

This Linux kernel change "scsi: mpt3sas: Mark expected switch fall-through" is included in the Linux 5.3 release. This change is authored by Gustavo A. R. Silva <gustavo [at] embeddedor.com> on Tue Jun 11 10:02:19 2019 -0500. The commit for this change in Linux stable tree is 6ea3b18 (patch).

scsi: mpt3sas: Mark expected switch fall-through

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

This patch fixes the following warning:

drivers/scsi/mpt3sas/mpt3sas_base.c: In function  _base_update_ioc_page1_inlinewith_perf_mode :
drivers/scsi/mpt3sas/mpt3sas_base.c:4510:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (ioc->high_iops_queues) {
      ^
drivers/scsi/mpt3sas/mpt3sas_base.c:4530:2: note: here
  case MPT_PERF_MODE_LATENCY:
  ^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

Fixes: 30cb97023f38 ("scsi: mpt3sas: Introduce perf_mode module parameter")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

There is one line of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/scsi/mpt3sas/mpt3sas_base.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index e6377ec..9fefcd1 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -4527,6 +4527,7 @@ void mpt3sas_base_clear_st(struct MPT3SAS_ADAPTER *ioc,
            ioc_info(ioc, "performance mode: balanced\n");
            return;
        }
+       /* Fall through */
    case MPT_PERF_MODE_LATENCY:
        /*
         * Enable interrupt coalescing on all reply queues

Leave a Reply

Your email address will not be published. Required fields are marked *