Skip to content

Commit 0c90293

Browse files
steffen-maiermartinkpetersen
authored andcommitted
scsi: zfcp: drop default switch case which might paper over missing case
This was introduced with v4.18 commit 8c3d20a ("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 <[email protected]> Reviewed-by: Benjamin Block <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 3505144 commit 0c90293

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/s390/scsi/zfcp_erp.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,6 @@ static enum zfcp_erp_act_type zfcp_erp_handle_failed(
151151
adapter, ZFCP_STATUS_COMMON_ERP_FAILED);
152152
}
153153
break;
154-
default:
155-
need = 0;
156-
break;
157154
}
158155

159156
return need;

0 commit comments

Comments
 (0)