Skip to content

Commit c52114d

Browse files
apopple-nvidiatorvalds
authored andcommitted
lib/test_hmm: remove set but unused page variable
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/20210706025603.4059-1-apopple@nvidia.com Fixes: b659bae ("mm: selftests for exclusive device memory") Signed-off-by: Alistair Popple <apopple@nvidia.com> Reported-by: Hulk Robot <hulkci@huawei.com> Reported-by: kernel test robot <oliver.sang@intel.com> Reported-by: Yang Yingliang <yangyingliang@huawei.com> Acked-by: Souptick Joarder <jrdr.linux@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent ab7965d commit c52114d

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

‎lib/test_hmm.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,10 +628,8 @@ static int dmirror_check_atomic(struct dmirror *dmirror, unsigned long start,
628628

629629
for (pfn = start >> PAGE_SHIFT; pfn < (end >> PAGE_SHIFT); pfn++) {
630630
void *entry;
631-
struct page *page;
632631

633632
entry = xa_load(&dmirror->pt, pfn);
634-
page = xa_untag_pointer(entry);
635633
if (xa_pointer_tag(entry) == DPT_XA_TAG_ATOMIC)
636634
return -EPERM;
637635
}

0 commit comments

Comments
 (0)