IB/ehca: handle negative return value from ibmebus_request_irq() properly in ehca_create_eq() - Kernel

This is a discussion on IB/ehca: handle negative return value from ibmebus_request_irq() properly in ehca_create_eq() - Kernel ; Signed-off-by: Hoang-Nam Nguyen --- drivers/infiniband/hw/ehca/ehca_eq.c | 35 ++++++++++++++++----------------- 1 files changed, 17 insertions(+), 18 deletions(-) diff --git a/drivers/infiniband/hw/ehca/ehca_eq.c b/drivers/infiniband/hw/ehca/ehca_eq.c index b4ac617..49660df 100644 --- a/drivers/infiniband/hw/ehca/ehca_eq.c +++ b/drivers/infiniband/hw/ehca/ehca_eq.c @@ -54,7 +54,8 @@ int ehca_create_eq(struct ehca_shca *shca, struct ehca_eq *eq, const enum ehca_eq_type ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: IB/ehca: handle negative return value from ibmebus_request_irq() properly in ehca_create_eq()

  1. IB/ehca: handle negative return value from ibmebus_request_irq() properly in ehca_create_eq()

    Signed-off-by: Hoang-Nam Nguyen
    ---
    drivers/infiniband/hw/ehca/ehca_eq.c | 35 ++++++++++++++++-----------------
    1 files changed, 17 insertions(+), 18 deletions(-)

    diff --git a/drivers/infiniband/hw/ehca/ehca_eq.c b/drivers/infiniband/hw/ehca/ehca_eq.c
    index b4ac617..49660df 100644
    --- a/drivers/infiniband/hw/ehca/ehca_eq.c
    +++ b/drivers/infiniband/hw/ehca/ehca_eq.c
    @@ -54,7 +54,8 @@ int ehca_create_eq(struct ehca_shca *shca,
    struct ehca_eq *eq,
    const enum ehca_eq_type type, const u32 length)
    {
    - u64 ret;
    + int ret;
    + u64 h_ret;
    u32 nr_pages;
    u32 i;
    void *vpage;
    @@ -73,15 +74,15 @@ int ehca_create_eq(struct ehca_shca *shca,
    return -EINVAL;
    }

    - ret = hipz_h_alloc_resource_eq(shca->ipz_hca_handle,
    - &eq->pf,
    - type,
    - length,
    - &eq->ipz_eq_handle,
    - &eq->length,
    - &nr_pages, &eq->ist);
    + h_ret = hipz_h_alloc_resource_eq(shca->ipz_hca_handle,
    + &eq->pf,
    + type,
    + length,
    + &eq->ipz_eq_handle,
    + &eq->length,
    + &nr_pages, &eq->ist);

    - if (ret != H_SUCCESS) {
    + if (h_ret != H_SUCCESS) {
    ehca_err(ib_dev, "Can't allocate EQ/NEQ. eq=%p", eq);
    return -EINVAL;
    }
    @@ -97,24 +98,22 @@ int ehca_create_eq(struct ehca_shca *shca,
    u64 rpage;

    vpage = ipz_qpageit_get_inc(&eq->ipz_queue);
    - if (!vpage) {
    - ret = H_RESOURCE;
    + if (!vpage)
    goto create_eq_exit2;
    - }

    rpage = virt_to_abs(vpage);
    - ret = hipz_h_register_rpage_eq(shca->ipz_hca_handle,
    - eq->ipz_eq_handle,
    - &eq->pf,
    - 0, 0, rpage, 1);
    + h_ret = hipz_h_register_rpage_eq(shca->ipz_hca_handle,
    + eq->ipz_eq_handle,
    + &eq->pf,
    + 0, 0, rpage, 1);

    if (i == (nr_pages - 1)) {
    /* last page */
    vpage = ipz_qpageit_get_inc(&eq->ipz_queue);
    - if (ret != H_SUCCESS || vpage)
    + if (h_ret != H_SUCCESS || vpage)
    goto create_eq_exit2;
    } else {
    - if (ret != H_PAGE_REGISTERED || !vpage)
    + if (h_ret != H_PAGE_REGISTERED || !vpage)
    goto create_eq_exit2;
    }
    }
    --
    1.5.5



    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: IB/ehca: handle negative return value from ibmebus_request_irq() properly in ehca_create_eq()

    thanks, applied
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread