scsi: zfcp: drop default switch case which might paper over missing case

This change “scsi: zfcp: drop default switch case which might paper over missing case” (commit 0c90293) in Linux kernel is authored by Steffen Maier <maier [at] linux.ibm.com> on Thu Nov 8 15:44:57 2018 +0100.

Description of "scsi: zfcp: drop default switch case which might paper over missing case"

The change “scsi: zfcp: drop default switch case which might paper over missing case” introduces changes as follows.

scsi: zfcp: drop default switch case which might paper over missing case

This was introduced with v4.18 commit 8c3d20aada70 ("scsi: zfcp: fix
missing REC trigger trace for all objects in ERP_FAILED") but would now
suppress helpful -Wswitch compiler warnings when building with W=1 such as
the following forced example:

drivers/s390/scsi/zfcp_erp.c: In function 'zfcp_erp_handle_failed':
drivers/s390/scsi/zfcp_erp.c:126:2: warning: enumeration value 'ZFCP_ERP_ACTION_REOPEN_PORT_FORCED' not handled in switch [-Wswitch]
  switch (want) {
  ^~~~~~

But then again, only with W=1 we would notice unhandled enum cases.
Without the default cases and a missed unhandled enum case, the code might
perform unforeseen things we might not want...

As of today, we never run through the removed default case, so removing it
is no functional change.  In the future, we never should run through a
default case but introduce the necessary specific case(s) to handle new
functionality.

Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Linux kernel releases containing commit 0c90293

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "scsi: zfcp: drop default switch case which might paper over missing case"

There are 3 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/s390/scsi/zfcp_erp.c | 3 ---
 1 file changed, 3 deletions(-)
 
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index b2845c5b8106..9345fed3bb37 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -151,9 +151,6 @@ static enum zfcp_erp_act_type zfcp_erp_handle_failed(
 				adapter, ZFCP_STATUS_COMMON_ERP_FAILED);
 		}
 		break;
-	default:
-		need = 0;
-		break;
 	}
 
 	return need;

The commit for this change in Linux stable tree is 0c90293 (patch).

Last modified: 2020/02/09