[jgunthorpe:iommufd 4/11] drivers/iommu/iommufd/pages.c:472:35: error: passing argument 1 of 'atomic64_read' from incompatible pointer type

From: kernel test robot
Date: Sun Feb 20 2022 - 16:22:59 EST


tree: https://github.com/jgunthorpe/linux iommufd
head: eb047b2ba449f66ffc3f427bb50c9ca60f6c9b95
commit: 72a206491bb65ff62cca14b086edd5ff35625873 [4/11] iommufd: Data structure for PFN storage
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220221/202202210555.Jl3so3EM-lkp@xxxxxxxxx/config)
compiler: arceb-elf-gcc (GCC) 11.2.0
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
# https://github.com/jgunthorpe/linux/commit/72a206491bb65ff62cca14b086edd5ff35625873
git remote add jgunthorpe https://github.com/jgunthorpe/linux
git fetch --no-tags jgunthorpe iommufd
git checkout 72a206491bb65ff62cca14b086edd5ff35625873
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash

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

All errors (new ones prefixed by >>):

In file included from arch/arc/include/asm/bug.h:30,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/gfp.h:5,
from include/linux/slab.h:15,
from drivers/iommu/iommufd/pages.c:45:
drivers/iommu/iommufd/pages.c: In function 'update_unpinned':
>> drivers/iommu/iommufd/pages.c:472:35: error: passing argument 1 of 'atomic64_read' from incompatible pointer type [-Werror=incompatible-pointer-types]
472 | WARN_ON(atomic64_read(&pages->source_user->locked_vm) < npages))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| atomic_long_t * {aka atomic_t *}
include/asm-generic/bug.h:121:32: note: in definition of macro 'WARN_ON'
121 | int __ret_warn_on = !!(condition); \
| ^~~~~~~~~
In file included from include/linux/atomic.h:82,
from include/asm-generic/bitops/lock.h:5,
from arch/arc/include/asm/bitops.h:188,
from include/linux/bitops.h:33,
from include/linux/log2.h:12,
from include/asm-generic/div64.h:55,
from ./arch/arc/include/generated/asm/div64.h:1,
from include/linux/math.h:5,
from include/linux/math64.h:6,
from include/linux/time64.h:5,
from include/linux/restart_block.h:10,
from include/linux/thread_info.h:14,
from include/asm-generic/preempt.h:5,
from ./arch/arc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:55,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/slab.h:15,
from drivers/iommu/iommufd/pages.c:45:
include/linux/atomic/atomic-instrumented.h:644:33: note: expected 'const atomic64_t *' but argument is of type 'atomic_long_t *' {aka 'atomic_t *'}
644 | atomic64_read(const atomic64_t *v)
| ~~~~~~~~~~~~~~~~~~^
>> drivers/iommu/iommufd/pages.c:474:30: error: passing argument 2 of 'atomic64_sub' from incompatible pointer type [-Werror=incompatible-pointer-types]
474 | atomic64_sub(npages, &pages->source_user->locked_vm);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| atomic_long_t * {aka atomic_t *}
In file included from include/linux/atomic.h:82,
from include/asm-generic/bitops/lock.h:5,
from arch/arc/include/asm/bitops.h:188,
from include/linux/bitops.h:33,
from include/linux/log2.h:12,
from include/asm-generic/div64.h:55,
from ./arch/arc/include/generated/asm/div64.h:1,
from include/linux/math.h:5,
from include/linux/math64.h:6,
from include/linux/time64.h:5,
from include/linux/restart_block.h:10,
from include/linux/thread_info.h:14,
from include/asm-generic/preempt.h:5,
from ./arch/arc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:55,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/slab.h:15,
from drivers/iommu/iommufd/pages.c:45:
include/linux/atomic/atomic-instrumented.h:740:33: note: expected 'atomic64_t *' but argument is of type 'atomic_long_t *' {aka 'atomic_t *'}
740 | atomic64_sub(s64 i, atomic64_t *v)
| ~~~~~~~~~~~~^
cc1: some warnings being treated as errors


vim +/atomic64_read +472 drivers/iommu/iommufd/pages.c

461
462 static void update_unpinned(struct iopt_pages *pages)
463 {
464 unsigned long npages = pages->last_npinned - pages->npinned;
465
466 lockdep_assert_held(&pages->mutex);
467
468 if (pages->has_cap_ipc_lock)
469 return;
470
471 if (WARN_ON(pages->npinned > pages->last_npinned) ||
> 472 WARN_ON(atomic64_read(&pages->source_user->locked_vm) < npages))
473 return;
> 474 atomic64_sub(npages, &pages->source_user->locked_vm);
475 atomic64_sub(npages, &pages->source_mm->pinned_vm);
476 pages->last_npinned = pages->npinned;
477 }
478

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