summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Maier <maier@linux.ibm.com>2018-11-08 15:44:57 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-21 10:34:29 +0100
commit8eee80a70a2bda85439ce6412b8f48867f9e3d50 (patch)
treebe9dab9d51ae4b0e23a00395b5eb02dcb1a1dafd
parent32b06fd3484795632ccf6a1da7d18a0890162d5c (diff)
downloadlinux-stable-8eee80a70a2bda85439ce6412b8f48867f9e3d50.tar.gz
linux-stable-8eee80a70a2bda85439ce6412b8f48867f9e3d50.tar.bz2
linux-stable-8eee80a70a2bda85439ce6412b8f48867f9e3d50.zip
scsi: zfcp: drop default switch case which might paper over missing case
[ Upstream commit 0c902936e55cff9335b27ed632fc45e7115ced75 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/s390/scsi/zfcp_erp.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index cc62d8cc8cfd..d5214c4eb9dd 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -178,9 +178,6 @@ static int zfcp_erp_handle_failed(int want, struct zfcp_adapter *adapter,
adapter, ZFCP_STATUS_COMMON_ERP_FAILED);
}
break;
- default:
- need = 0;
- break;
}
return need;