All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA: error code handling
@ 2020-08-24 23:44 Tong Zhang
  2020-09-02  9:03 ` Leon Romanovsky
  2020-09-09 16:38 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: Tong Zhang @ 2020-08-24 23:44 UTC (permalink / raw)
  To: selvin.xavier, devesh.sharma, dledford, jgg, kamalheib1, leon,
	maxg, monis, ztong0001, gustavoars, galpress, linux-rdma,
	linux-kernel
  Cc: Bernard Metzler

ocrdma_qp_state_change() returns 1 when new and old state are the same,
however caller is checking using <0

Signed-off-by: Tong Zhang <ztong0001@gmail.com>
---
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index c1751c9a0f62..518687c5e2cb 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
@@ -1384,7 +1384,7 @@ int _ocrdma_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 	/* if new and previous states are same hw doesn't need to
 	 * know about it.
 	 */
-	if (status < 0)
+	if (status == 1)
 		return status;
 	return ocrdma_mbx_modify_qp(dev, qp, attr, attr_mask);
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] RDMA: error code handling
  2020-08-24 23:44 [PATCH] RDMA: error code handling Tong Zhang
@ 2020-09-02  9:03 ` Leon Romanovsky
  2020-09-09 16:38 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2020-09-02  9:03 UTC (permalink / raw)
  To: Tong Zhang
  Cc: selvin.xavier, devesh.sharma, dledford, jgg, kamalheib1, maxg,
	monis, gustavoars, galpress, linux-rdma, linux-kernel,
	Bernard Metzler

On Mon, Aug 24, 2020 at 07:44:21PM -0400, Tong Zhang wrote:
> ocrdma_qp_state_change() returns 1 when new and old state are the same,
> however caller is checking using <0
>
> Signed-off-by: Tong Zhang <ztong0001@gmail.com>
> ---
>  drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Fixes: 057729cb2347 ("RDMA/ocrdma: Remove driver QP state machine")

Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] RDMA: error code handling
  2020-08-24 23:44 [PATCH] RDMA: error code handling Tong Zhang
  2020-09-02  9:03 ` Leon Romanovsky
@ 2020-09-09 16:38 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2020-09-09 16:38 UTC (permalink / raw)
  To: Tong Zhang
  Cc: selvin.xavier, devesh.sharma, dledford, kamalheib1, leon, maxg,
	monis, gustavoars, galpress, linux-rdma, linux-kernel,
	Bernard Metzler

On Mon, Aug 24, 2020 at 07:44:21PM -0400, Tong Zhang wrote:
> ocrdma_qp_state_change() returns 1 when new and old state are the same,
> however caller is checking using <0
> 
> Signed-off-by: Tong Zhang <ztong0001@gmail.com>
>  drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> index c1751c9a0f62..518687c5e2cb 100644
> +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> @@ -1384,7 +1384,7 @@ int _ocrdma_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
>  	/* if new and previous states are same hw doesn't need to
>  	 * know about it.
>  	 */
> -	if (status < 0)
> +	if (status == 1)
>  		return status;
>  	return ocrdma_mbx_modify_qp(dev, qp, attr, attr_mask);

I'm not comfortable with this patch unless someone from Broadcom
approves it.

Skipping the modify_qp just because the state is the same looks wrong
to me in the first place, I would rather see the dead code removed as
a no-change patch.

Jason

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-09 16:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-24 23:44 [PATCH] RDMA: error code handling Tong Zhang
2020-09-02  9:03 ` Leon Romanovsky
2020-09-09 16:38 ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.