Commit d999bc81 authored by Changcheng Deng's avatar Changcheng Deng Committed by Alex Deucher

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

Use max() and min() in order to make code cleaner.
Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarChangcheng Deng <deng.changcheng@zte.com.cn>
Reviewed-by: default avatarPhilip Yang <Philip.Yang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment