Skip to content

Commit

Permalink
lib/test_hmm: remove set but unused page variable
Browse files Browse the repository at this point in the history
The HMM selftests use atomic_check_access() to check atomic access to a
page has been revoked.  It doesn't matter if the page mapping has been
removed from the mirrored page tables as that also implies atomic access
has been revoked.  Therefore remove the unused page variable to fix this
compiler warning:

  lib/test_hmm.c:631:16: warning: variable `page' set but not used [-Wunused-but-set-variable]

Link: https://lkml.kernel.org/r/[email protected]
Fixes: b659bae ("mm: selftests for exclusive device memory")
Signed-off-by: Alistair Popple <[email protected]>
Reported-by: Hulk Robot <[email protected]>
Reported-by: kernel test robot <[email protected]>
Reported-by: Yang Yingliang <[email protected]>
Acked-by: Souptick Joarder <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
apopple-nvidia authored and torvalds committed Jul 15, 2021
1 parent ab7965d commit c52114d
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/test_hmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,8 @@ static int dmirror_check_atomic(struct dmirror *dmirror, unsigned long start,

for (pfn = start >> PAGE_SHIFT; pfn < (end >> PAGE_SHIFT); pfn++) {
void *entry;
struct page *page;

entry = xa_load(&dmirror->pt, pfn);
page = xa_untag_pointer(entry);
if (xa_pointer_tag(entry) == DPT_XA_TAG_ATOMIC)
return -EPERM;
}
Expand Down

0 comments on commit c52114d

Please sign in to comment.