Skip to content

Commit

Permalink
RDMA/hns: Use delay instead of usleep
Browse files Browse the repository at this point in the history
In order to avoid using usleep function in lock function, we use delay
function instead of it.  Besides, it also use brackets for standardized
the computed order.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Lijun Ou authored and Jason Gunthorpe committed Jul 26, 2018
1 parent 26f63b9 commit 73b4e1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/hns/hns_roce_hem.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ int hns_roce_calc_hem_mhop(struct hns_roce_dev *hr_dev,
case 3:
mhop->l2_idx = table_idx & (chunk_ba_num - 1);
mhop->l1_idx = table_idx / chunk_ba_num & (chunk_ba_num - 1);
mhop->l0_idx = table_idx / chunk_ba_num / chunk_ba_num;
mhop->l0_idx = (table_idx / chunk_ba_num) / chunk_ba_num;
break;
case 2:
mhop->l1_idx = table_idx & (chunk_ba_num - 1);
Expand Down Expand Up @@ -342,7 +342,7 @@ static int hns_roce_set_hem(struct hns_roce_dev *hr_dev,
} else {
break;
}
msleep(HW_SYNC_SLEEP_TIME_INTERVAL);
mdelay(HW_SYNC_SLEEP_TIME_INTERVAL);
}

bt_cmd_l = (u32)bt_ba;
Expand Down

0 comments on commit 73b4e1f

Please sign in to comment.