[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1620382961-69701-1-git-send-email-jiapeng.chong@linux.alibaba.com>
Date: Fri, 7 May 2021 18:22:41 +0800
From: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
To: yishaih@...dia.com
Cc: dledford@...hat.com, jgg@...pe.ca, linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org,
Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Subject: [PATCH] RDMA/mlx4: Remove unnessesary check in mlx4_ib_modify_wq()
cur_state and new_state are enums and when GCC considers
them as unsigned, the conditions are never met.
Clean up the following smatch warning:
drivers/infiniband/hw/mlx4/qp.c:4258 mlx4_ib_modify_wq() warn: unsigned
'cur_state' is never less than zero.
Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
---
drivers/infiniband/hw/mlx4/qp.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 92ddbcc..162aa59 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -4255,8 +4255,7 @@ int mlx4_ib_modify_wq(struct ib_wq *ibwq, struct ib_wq_attr *wq_attr,
ibwq->state;
new_state = wq_attr_mask & IB_WQ_STATE ? wq_attr->wq_state : cur_state;
- if (cur_state < IB_WQS_RESET || cur_state > IB_WQS_ERR ||
- new_state < IB_WQS_RESET || new_state > IB_WQS_ERR)
+ if (cur_state > IB_WQS_ERR || new_state > IB_WQS_ERR)
return -EINVAL;
if ((new_state == IB_WQS_RDY) && (cur_state == IB_WQS_ERR))
--
1.8.3.1
Powered by blists - more mailing lists