mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 04:04:26 +08:00
lib: test_hmm: use min() to improve dmirror_exclusive()
Use min() to simplify the dmirror_exclusive() function and improve its readability. Link: https://lkml.kernel.org/r/20240726131245.161695-1-thorsten.blum@toblux.com Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> Reviewed-by: David Hildenbrand <david@redhat.com> Cc: Jérôme Glisse <jglisse@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
073ebebd18
commit
592c9330e3
@ -799,10 +799,7 @@ static int dmirror_exclusive(struct dmirror *dmirror,
|
||||
unsigned long mapped = 0;
|
||||
int i;
|
||||
|
||||
if (end < addr + (ARRAY_SIZE(pages) << PAGE_SHIFT))
|
||||
next = end;
|
||||
else
|
||||
next = addr + (ARRAY_SIZE(pages) << PAGE_SHIFT);
|
||||
next = min(end, addr + (ARRAY_SIZE(pages) << PAGE_SHIFT));
|
||||
|
||||
ret = make_device_exclusive_range(mm, addr, next, pages, NULL);
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user