Skip to content
  • Steffen Maier's avatar
    scsi: zfcp: use enum zfcp_erp_steps for struct zfcp_erp_action.step · 0023beec
    Steffen Maier authored
    Use the already defined enum for this purpose to get at least some build
    checking (even though an enum is type equivalent to an int in C).  v2.6.27
    commit 287ac01a
    
     ("[SCSI] zfcp: Cleanup code in zfcp_erp.c") introduced
    the enum which was cpp defines previously.
    
    Since struct zfcp_erp_action type is embedded into other structures living
    in zfcp_def.h, we have to move enum zfcp_erp_act_type from its private
    definition in zfcp_erp.c to the zfcp-global zfcp_def.h
    
    Silence some false -Wswitch compiler warning cases with individual NOP
    cases. When adding more enum values and building with W=1 we would get
    compiler warnings about missed new cases.
    
    Add missing break statements in some of the above switch cases.  No
    functional change, but making it future-proof.  I think all of these should
    have had a break statement ever since, even if these switch cases happened
    to be the last ones in the switch statement body.
    
    "Fall through" in the context of switch case usually means not to have a
    break and fall through to the subsequent switch case. However, I think this
    old comment meant that here we do not have an _early return_ in the switch
    case but the code path continues after the switch case body.
    
    Signed-off-by: default avatarSteffen Maier <maier@linux.ibm.com>
    Reviewed-by: default avatarBenjamin Block <bblock@linux.ibm.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    0023beec