Commit 6e0e85d3 authored by Gleb Chesnokov's avatar Gleb Chesnokov Committed by Martin K. Petersen

scsi: qla2xxx: Use named initializers for port_[d]state_str

Make port_state_str and port_dstate_str a little more readable and
maintainable by using named initializers.

Also convert FCS_* macros into an enum.

Link: https://lore.kernel.org/r/AS8PR10MB495215841EB25C16DBC0CB409D349@AS8PR10MB4952.EURPRD10.PROD.OUTLOOK.COMReviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: default avatarGleb Chesnokov <Chesnokov.G@raidix.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 482dcaa1
...@@ -2671,25 +2671,28 @@ struct event_arg { ...@@ -2671,25 +2671,28 @@ struct event_arg {
/* /*
* Fibre channel port/lun states. * Fibre channel port/lun states.
*/ */
#define FCS_UNCONFIGURED 1 enum {
#define FCS_DEVICE_DEAD 2 FCS_UNKNOWN,
#define FCS_DEVICE_LOST 3 FCS_UNCONFIGURED,
#define FCS_ONLINE 4 FCS_DEVICE_DEAD,
FCS_DEVICE_LOST,
FCS_ONLINE,
};
extern const char *const port_state_str[5]; extern const char *const port_state_str[5];
static const char * const port_dstate_str[] = { static const char *const port_dstate_str[] = {
"DELETED", [DSC_DELETED] = "DELETED",
"GNN_ID", [DSC_GNN_ID] = "GNN_ID",
"GNL", [DSC_GNL] = "GNL",
"LOGIN_PEND", [DSC_LOGIN_PEND] = "LOGIN_PEND",
"LOGIN_FAILED", [DSC_LOGIN_FAILED] = "LOGIN_FAILED",
"GPDB", [DSC_GPDB] = "GPDB",
"UPD_FCPORT", [DSC_UPD_FCPORT] = "UPD_FCPORT",
"LOGIN_COMPLETE", [DSC_LOGIN_COMPLETE] = "LOGIN_COMPLETE",
"ADISC", [DSC_ADISC] = "ADISC",
"DELETE_PEND", [DSC_DELETE_PEND] = "DELETE_PEND",
"LOGIN_AUTH_PEND", [DSC_LOGIN_AUTH_PEND] = "LOGIN_AUTH_PEND",
}; };
/* /*
......
...@@ -49,11 +49,11 @@ qla27xx_process_purex_fpin(struct scsi_qla_host *vha, struct purex_item *item) ...@@ -49,11 +49,11 @@ qla27xx_process_purex_fpin(struct scsi_qla_host *vha, struct purex_item *item)
} }
const char *const port_state_str[] = { const char *const port_state_str[] = {
"Unknown", [FCS_UNKNOWN] = "Unknown",
"UNCONFIGURED", [FCS_UNCONFIGURED] = "UNCONFIGURED",
"DEAD", [FCS_DEVICE_DEAD] = "DEAD",
"LOST", [FCS_DEVICE_LOST] = "LOST",
"ONLINE" [FCS_ONLINE] = "ONLINE"
}; };
static void static void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment