RDMA: error code handling
Subsystems (2)
PATCH 1/1 RDMA: error code handling
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 <[email protected]>
--- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +1 -1
@@ -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); }
Signature · 1 line
2.25.1
Quoted 8 lines · Tong Zhang
ocrdma_qp_state_change()returns 1 when new and old state are the same, however caller is checking using <0Signed-off-by Tong Zhang <[email protected]>--- 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 <[email protected]>
Jason Gunthorpe
maintainerQuoted 11 lines · Tong Zhang
ocrdma_qp_state_change()returns 1 when new and old state are the same, however caller is checking using <0Signed-off-by Tong Zhang <[email protected]>drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +1
-0+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c int _ocrdma_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, · line 1389
Quoted 7 lines
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +1
-1@@ -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