]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: zfcp: drop old default switch case which might paper over missing case
authorSteffen Maier <maier@linux.ibm.com>
Thu, 8 Nov 2018 14:44:58 +0000 (15:44 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 15 Nov 2018 20:01:18 +0000 (15:01 -0500)
commitc1a46f8b558a2fea01ccb62f44040a84e188daf8
tree68c26c9232a0660aa63861de45da7ec9d79dd6d1
parentaa04fdbc47f19ccc88cd7347a866011ea8342e46
scsi: zfcp: drop old default switch case which might paper over missing case

This was introduced with v2.6.27 commit 42ab632021bc ("[SCSI] zfcp: Cleanup
code in zfcp_erp.c") 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_setup_act':
drivers/s390/scsi/zfcp_erp.c:220:2: warning: enumeration value 'ZFCP_ERP_ACTION_REOPEN_PORT' not handled in switch [-Wswitch]
  switch (need) {
  ^~~~~~

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>
drivers/s390/scsi/zfcp_erp.c