aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames.Smart@Emulex.Com <James.Smart@Emulex.Com>2005-10-28 20:28:56 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-10-29 11:09:58 -0400
commit433c357956b5a9da79d42d9128dcacc32929f2dd (patch)
treea49a1d933c7335b3e950fc82af7bb5a53b855c1c
parentca61f10ab2b874b889e89d14ea09fae2dcccdca6 (diff)
[SCSI] lpfc: Cleanup code in lpfc_get_stats().
Cleanup white spaces in argument calls & initializations, prune if statements, remove casting and remove redundant if checks. Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 445da1d0cc88..a69013a9c39a 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -223,7 +223,7 @@ lpfc_issue_lip(struct Scsi_Host *host)
223 if (mbxstatus == MBX_TIMEOUT) 223 if (mbxstatus == MBX_TIMEOUT)
224 pmboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 224 pmboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
225 else 225 else
226 mempool_free( pmboxq, phba->mbox_mem_pool); 226 mempool_free(pmboxq, phba->mbox_mem_pool);
227 227
228 if (mbxstatus == MBXERR_ERROR) 228 if (mbxstatus == MBXERR_ERROR)
229 return -EIO; 229 return -EIO;
@@ -984,7 +984,7 @@ lpfc_get_stats(struct Scsi_Host *shost)
984 struct fc_host_statistics *hs = &phba->link_stats; 984 struct fc_host_statistics *hs = &phba->link_stats;
985 LPFC_MBOXQ_t *pmboxq; 985 LPFC_MBOXQ_t *pmboxq;
986 MAILBOX_t *pmb; 986 MAILBOX_t *pmb;
987 int rc=0; 987 int rc = 0;
988 988
989 pmboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 989 pmboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
990 if (!pmboxq) 990 if (!pmboxq)
@@ -997,18 +997,16 @@ lpfc_get_stats(struct Scsi_Host *shost)
997 pmboxq->context1 = NULL; 997 pmboxq->context1 = NULL;
998 998
999 if ((phba->fc_flag & FC_OFFLINE_MODE) || 999 if ((phba->fc_flag & FC_OFFLINE_MODE) ||
1000 (!(psli->sli_flag & LPFC_SLI2_ACTIVE))){ 1000 (!(psli->sli_flag & LPFC_SLI2_ACTIVE)))
1001 rc = lpfc_sli_issue_mbox(phba, pmboxq, MBX_POLL); 1001 rc = lpfc_sli_issue_mbox(phba, pmboxq, MBX_POLL);
1002 } else 1002 else
1003 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); 1003 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2);
1004 1004
1005 if (rc != MBX_SUCCESS) { 1005 if (rc != MBX_SUCCESS) {
1006 if (pmboxq) { 1006 if (rc == MBX_TIMEOUT)
1007 if (rc == MBX_TIMEOUT) 1007 pmboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
1008 pmboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 1008 else
1009 else 1009 mempool_free(pmboxq, phba->mbox_mem_pool);
1010 mempool_free( pmboxq, phba->mbox_mem_pool);
1011 }
1012 return NULL; 1010 return NULL;
1013 } 1011 }
1014 1012
@@ -1019,24 +1017,22 @@ lpfc_get_stats(struct Scsi_Host *shost)
1019 hs->rx_frames = pmb->un.varRdStatus.rcvFrameCnt; 1017 hs->rx_frames = pmb->un.varRdStatus.rcvFrameCnt;
1020 hs->rx_words = (pmb->un.varRdStatus.rcvByteCnt * 256); 1018 hs->rx_words = (pmb->un.varRdStatus.rcvByteCnt * 256);
1021 1019
1022 memset((void *)pmboxq, 0, sizeof (LPFC_MBOXQ_t)); 1020 memset(pmboxq, 0, sizeof (LPFC_MBOXQ_t));
1023 pmb->mbxCommand = MBX_READ_LNK_STAT; 1021 pmb->mbxCommand = MBX_READ_LNK_STAT;
1024 pmb->mbxOwner = OWN_HOST; 1022 pmb->mbxOwner = OWN_HOST;
1025 pmboxq->context1 = NULL; 1023 pmboxq->context1 = NULL;
1026 1024
1027 if ((phba->fc_flag & FC_OFFLINE_MODE) || 1025 if ((phba->fc_flag & FC_OFFLINE_MODE) ||
1028 (!(psli->sli_flag & LPFC_SLI2_ACTIVE))) { 1026 (!(psli->sli_flag & LPFC_SLI2_ACTIVE)))
1029 rc = lpfc_sli_issue_mbox(phba, pmboxq, MBX_POLL); 1027 rc = lpfc_sli_issue_mbox(phba, pmboxq, MBX_POLL);
1030 } else 1028 else
1031 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); 1029 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2);
1032 1030
1033 if (rc != MBX_SUCCESS) { 1031 if (rc != MBX_SUCCESS) {
1034 if (pmboxq) { 1032 if (rc == MBX_TIMEOUT)
1035 if (rc == MBX_TIMEOUT) 1033 pmboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
1036 pmboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 1034 else
1037 else 1035 mempool_free( pmboxq, phba->mbox_mem_pool);
1038 mempool_free( pmboxq, phba->mbox_mem_pool);
1039 }
1040 return NULL; 1036 return NULL;
1041 } 1037 }
1042 1038