提交 d999bc81 编写于 作者: C Changcheng Deng 提交者: Alex Deucher

drm/amdkfd: use max() and min() to make code cleaner

Use max() and min() in order to make code cleaner.
Reported-by: NZeal Robot <zealci@zte.com.cn>
Signed-off-by: NChangcheng Deng <deng.changcheng@zte.com.cn>
Reviewed-by: NPhilip Yang <Philip.Yang@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 d4c2933f
...@@ -2277,8 +2277,8 @@ svm_range_cpu_invalidate_pagetables(struct mmu_interval_notifier *mni, ...@@ -2277,8 +2277,8 @@ svm_range_cpu_invalidate_pagetables(struct mmu_interval_notifier *mni,
start = mni->interval_tree.start; start = mni->interval_tree.start;
last = mni->interval_tree.last; last = mni->interval_tree.last;
start = (start > range->start ? start : range->start) >> PAGE_SHIFT; start = max(start, range->start) >> PAGE_SHIFT;
last = (last < (range->end - 1) ? last : range->end - 1) >> PAGE_SHIFT; last = min(last, range->end - 1) >> PAGE_SHIFT;
pr_debug("[0x%lx 0x%lx] range[0x%lx 0x%lx] notifier[0x%lx 0x%lx] %d\n", pr_debug("[0x%lx 0x%lx] range[0x%lx 0x%lx] notifier[0x%lx 0x%lx] %d\n",
start, last, range->start >> PAGE_SHIFT, start, last, range->start >> PAGE_SHIFT,
(range->end - 1) >> PAGE_SHIFT, (range->end - 1) >> PAGE_SHIFT,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册