]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
RDMA/hns: fix inverted logic of readl read and shift
authorColin Ian King <colin.king@canonical.com>
Fri, 31 May 2019 09:21:01 +0000 (10:21 +0100)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 7 Jun 2019 17:56:26 +0000 (14:56 -0300)
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 <colin.king@canonical.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hns/hns_roce_hem.c

index 157c84a1f55f59eda3e416d8efe36cb892f44697..8490a86c3ef08b07a978767e13f08f27e2fc0633 100644 (file)
@@ -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);