lib/test_hmm.c:631:16: warning: variable 'page' set but not used

From: kernel test robot
Date: Sat Jul 03 2021 - 20:08:50 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 303392fd5c160822bf778270b28ec5ea50cab2b4
commit: b659baea75469f0c5bd26f18461dfcdc1bbbac82 mm: selftests for exclusive device memory
date: 2 days ago
config: x86_64-randconfig-a006-20210704 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project cb5de7c813f976dd458bd2a7f40702ba648bf650)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b659baea75469f0c5bd26f18461dfcdc1bbbac82
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout b659baea75469f0c5bd26f18461dfcdc1bbbac82
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> lib/test_hmm.c:631:16: warning: variable 'page' set but not used [-Wunused-but-set-variable]
struct page *page;
^
1 warning generated.


vim +/page +631 lib/test_hmm.c

623
624 static int dmirror_check_atomic(struct dmirror *dmirror, unsigned long start,
625 unsigned long end)
626 {
627 unsigned long pfn;
628
629 for (pfn = start >> PAGE_SHIFT; pfn < (end >> PAGE_SHIFT); pfn++) {
630 void *entry;
> 631 struct page *page;
632
633 entry = xa_load(&dmirror->pt, pfn);
634 page = xa_untag_pointer(entry);
635 if (xa_pointer_tag(entry) == DPT_XA_TAG_ATOMIC)
636 return -EPERM;
637 }
638
639 return 0;
640 }
641

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip