Skip to contentSkip to conversation

lpfc: Positive error return into negative

PATCH In review Roel Kluin 2 participants 2 messages Jan 29, 2010

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 lpfc: Positive error return into negative

In the comment on top of lpfc_sli_hbq_setup() and of its caller which transmits this error, lpfc_sli_hba_setup(), it is stated that the function should return a negative error code.

---

drivers/scsi/lpfc/lpfc_sli.c +1 -1
index 589549b..a960736 100644
@@ -3709,7 +3709,7 @@ lpfc_sli_hbq_setup(struct lpfc_hba *phba)
 
 			phba->link_state = LPFC_HBA_ERROR;
 			mempool_free(pmb, phba->mbox_mem_pool);
-			return ENXIO;
+			return -ENXIO;
 		}
 	}
 	phba->hbq_count = hbq_count;
Acked-by on v1 1/1
#1 lore raw

This is innoculous as the code really only cares whether it's zero or non-zero. But, there's no harm in being consistent.

-- james s

Quoted 21 lines · Roel Kluin

In the comment on top of lpfc_sli_hbq_setup() and of its caller which transmits this error, lpfc_sli_hba_setup(), it is stated that the function should return a negative error code.

---

drivers/scsi/lpfc/lpfc_sli.c +1 -1
index 589549b..a960736 100644
@@ -3709,7 +3709,7 @@ lpfc_sli_hbq_setup(struct lpfc_hba *phba)
 
 			phba->link_state = LPFC_HBA_ERROR;
 			mempool_free(pmb, phba->mbox_mem_pool);
-			return ENXIO;
+			return -ENXIO;
 		}
 	}
 	phba->hbq_count = hbq_count;