Skip to content

Commit

Permalink
RDMA/hns: fix inverted logic of readl read and shift
Browse files Browse the repository at this point in the history
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: 669cefb ("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>
  • Loading branch information
Colin Ian King authored and Jason Gunthorpe committed Jun 7, 2019
1 parent bcef5b7 commit fa02732
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/hns/hns_roce_hem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fa02732

Please sign in to comment.