> Avoid assigning an IS_ERR value to the cm id pointer in the cma_id object.
> This fixes a few anomalies in the error flow, and eliminates the need to
> test for the IS_ERR value every time we wish to determine if the cma_id object
> has a cm device associated with it.
>
> Also, eliminate the now-unnecessary procedure cma_has_cm_dev (we can check
> directly
> for the existence of the device pointer -- for a non-NULL check, makes no
> difference
> if it is the iwarp or the ib pointer).
>
> Finally, I suggest a few code changes here to improve coding consistency.
>
> Signed-off-by: Jack Morgenstein <[email protected]>
>
> ---
> Sean,
> Here is the patch I said I would submit to you.
> I got rid of the cma_has_cm_dev() procedure, but if you think that it should
> be kept,
> but simply do the ib-pointer check only (to keep ib out of the rdma level),
> that is OK with me.
Thanks for doing this. The patch looks good to me with one nit:
> diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
> index b6a33b3..85ce489 100644
> --- a/drivers/infiniband/core/cma.c
> +++ b/drivers/infiniband/core/cma.c
> @@ -2577,7 +2579,7 @@ static int cma_connect_ib(struct rdma_id_private
> *id_priv,
>
> ret = ib_send_cm_req(id_priv->cm_id.ib, &req);
> out:
> - if (ret && !IS_ERR(id_priv->cm_id.ib)) {
> + if (ret && !IS_ERR(id)) {
> ib_destroy_cm_id(id_priv->cm_id.ib);
I would change the above line to ib_destroy_cm_id(id) to align the destroy call
with the if statement.
- Sean
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html