
From: Xinghai Cen <cenxinghai@h-partners.com> driver inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IATYMO ---------------------------------------------------------------------- This reverts commit b2156fee26940b5bd13d66bac44e3e3ee625a069. Signed-off-by: Xinghai Cen <cenxinghai@h-partners.com> --- drivers/infiniband/hw/hns/hns_roce_hem.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hem.c b/drivers/infiniband/hw/hns/hns_roce_hem.c index cdb231e16fe2..1958987e503b 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hem.c +++ b/drivers/infiniband/hw/hns/hns_roce_hem.c @@ -1042,9 +1042,9 @@ static bool hem_list_is_bottom_bt(int hopnum, int bt_level) * @bt_level: base address table level * @unit: ba entries per bt page */ -static u64 hem_list_calc_ba_range(int hopnum, int bt_level, int unit) +static u32 hem_list_calc_ba_range(int hopnum, int bt_level, int unit) { - u64 step; + u32 step; int max; int i; @@ -1080,7 +1080,7 @@ int hns_roce_hem_list_calc_root_ba(const struct hns_roce_buf_region *regions, { struct hns_roce_buf_region *r; int total = 0; - u64 step; + int step; int i; for (i = 0; i < region_cnt; i++) { @@ -1111,7 +1111,7 @@ static int hem_list_alloc_mid_bt(struct hns_roce_dev *hr_dev, int ret = 0; int max_ofs; int level; - u64 step; + u32 step; int end; if (hopnum <= 1) @@ -1150,7 +1150,7 @@ static int hem_list_alloc_mid_bt(struct hns_roce_dev *hr_dev, } start_aligned = (distance / step) * step + r->offset; - end = min_t(u64, start_aligned + step - 1, max_ofs); + end = min_t(int, start_aligned + step - 1, max_ofs); cur = hem_list_alloc_item(hr_dev, start_aligned, end, unit, true); if (!cur) { @@ -1238,7 +1238,7 @@ static int setup_middle_bt(struct hns_roce_dev *hr_dev, void *cpu_base, struct hns_roce_hem_item *hem, *temp_hem; int total = 0; int offset; - u64 step; + int step; step = hem_list_calc_ba_range(r->hopnum, 1, unit); if (step < 1) -- 2.33.0