From: Colin Ian King Date: Fri, 31 May 2019 09:21:01 +0000 (+0100) Subject: RDMA/hns: fix inverted logic of readl read and shift X-Git-Tag: v5.4-rc1~555^2~144 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa027328a1c93d72031e6cc6b4a7eee967fd7406;p=platform%2Fkernel%2Flinux-rpi.git RDMA/hns: fix inverted logic of readl read and shift A previous change incorrectly changed the inverted logic and logically negated the readl rather than the shifted readl result. Fix this by adding in missing parentheses around the expression that needs to be logically negated. Addresses-Coverity: ("Logically dead code") Fixes: 669cefb654cb ("RDMA/hns: Remove jiffies operation in disable interrupt context") Signed-off-by: Colin Ian King Signed-off-by: Jason Gunthorpe --- diff --git a/drivers/infiniband/hw/hns/hns_roce_hem.c b/drivers/infiniband/hw/hns/hns_roce_hem.c index 157c84a..8490a86 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hem.c +++ b/drivers/infiniband/hw/hns/hns_roce_hem.c @@ -378,7 +378,7 @@ static int hns_roce_set_hem(struct hns_roce_dev *hr_dev, end = HW_SYNC_TIMEOUT_MSECS; while (end) { - if (!readl(bt_cmd) >> BT_CMD_SYNC_SHIFT) + if (!(readl(bt_cmd) >> BT_CMD_SYNC_SHIFT)) break; mdelay(HW_SYNC_SLEEP_TIME_INTERVAL);