2010-01-29 10:03:24

by Roel Kluin

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: Roel Kluin <[email protected]>
---
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 589549b..a960736 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -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;


2010-01-29 19:31:25

by James Smart

[permalink] [raw]
Subject: Re: [PATCH] lpfc: Positive error return into negative

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

Acked-by: James Smart <[email protected]>

-- james s


Roel Kluin wrote:
> 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.
>
> Signed-off-by: Roel Kluin <[email protected]>
> ---
> diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
> index 589549b..a960736 100644
> --- a/drivers/scsi/lpfc/lpfc_sli.c
> +++ b/drivers/scsi/lpfc/lpfc_sli.c
> @@ -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;
>
>