tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c:102:3: warning: format specifies type 'unsigned long' but the argument has type 'u64' (aka 'unsigned long long')
kernel test robot
build bottree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 053966c344dbd346e71305f530e91ea77916189f commit: 080723f4d4c3c6fb0720aae614deb1f30ee9ef2e [7345/8302] vfio: selftests: Add vfio_dma_mapping_mmio_test config: i386-allnoconfig-bpf (https://download.01.org/0day-ci/archive/20260121/[email protected]/config) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260121/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:32:37: note: expanded from macro 'VFIO_ASSERT_EQ'
32 | #define VFIO_ASSERT_EQ(_a, _b, ...) VFIO_ASSERT_OP(_a, _b, ==, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:27:4: note: expanded from macro 'VFIO_ASSERT_OP'
26 | fprintf(stderr, " Observed: %#lx %s %#lx\n", \
| ~~~~
27 | (u64)__lhs, #_op, (u64)__rhs); \
| ^~~~~~~~~~
In file included from tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c:11:
In file included from tools/testing/selftests/vfio/lib/include/libvfio.h:6:
tools/testing/selftests/vfio/lib/include/libvfio/iommu.h:49:2: warning: format specifies type 'unsigned long' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
49 | VFIO_ASSERT_EQ(__iommu_unmap(iommu, region, NULL), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:32:37: note: expanded from macro 'VFIO_ASSERT_EQ'
32 | #define VFIO_ASSERT_EQ(_a, _b, ...) VFIO_ASSERT_OP(_a, _b, ==, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:27:22: note: expanded from macro 'VFIO_ASSERT_OP'
26 | fprintf(stderr, " Observed: %#lx %s %#lx\n", \
| ~~~~
27 | (u64)__lhs, #_op, (u64)__rhs); \
| ^~~~~~~~~~
In file included from tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c:11:
In file included from tools/testing/selftests/vfio/lib/include/libvfio.h:6:
tools/testing/selftests/vfio/lib/include/libvfio/iommu.h:56:2: warning: format specifies type 'unsigned long' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
56 | VFIO_ASSERT_EQ(__iommu_unmap_all(iommu, NULL), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:32:37: note: expanded from macro 'VFIO_ASSERT_EQ'
32 | #define VFIO_ASSERT_EQ(_a, _b, ...) VFIO_ASSERT_OP(_a, _b, ==, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:27:4: note: expanded from macro 'VFIO_ASSERT_OP'
26 | fprintf(stderr, " Observed: %#lx %s %#lx\n", \
| ~~~~
27 | (u64)__lhs, #_op, (u64)__rhs); \
| ^~~~~~~~~~
In file included from tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c:11:
In file included from tools/testing/selftests/vfio/lib/include/libvfio.h:6:
tools/testing/selftests/vfio/lib/include/libvfio/iommu.h:56:2: warning: format specifies type 'unsigned long' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
56 | VFIO_ASSERT_EQ(__iommu_unmap_all(iommu, NULL), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:32:37: note: expanded from macro 'VFIO_ASSERT_EQ'
32 | #define VFIO_ASSERT_EQ(_a, _b, ...) VFIO_ASSERT_OP(_a, _b, ==, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:27:22: note: expanded from macro 'VFIO_ASSERT_OP'
26 | fprintf(stderr, " Observed: %#lx %s %#lx\n", \
| ~~~~
27 | (u64)__lhs, #_op, (u64)__rhs); \
| ^~~~~~~~~~
In file included from tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c:11:
In file included from tools/testing/selftests/vfio/lib/include/libvfio.h:8:
tools/testing/selftests/vfio/lib/include/libvfio/vfio_pci_device.h:78:2: warning: format specifies type 'unsigned long' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
78 | VFIO_ASSERT_NE(r, -1, "F_GETFL failed for fd %d\n", fd);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:33:37: note: expanded from macro 'VFIO_ASSERT_NE'
33 | #define VFIO_ASSERT_NE(_a, _b, ...) VFIO_ASSERT_OP(_a, _b, !=, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:27:4: note: expanded from macro 'VFIO_ASSERT_OP'
26 | fprintf(stderr, " Observed: %#lx %s %#lx\n", \
| ~~~~
27 | (u64)__lhs, #_op, (u64)__rhs); \
| ^~~~~~~~~~
In file included from tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c:11:
In file included from tools/testing/selftests/vfio/lib/include/libvfio.h:8:
tools/testing/selftests/vfio/lib/include/libvfio/vfio_pci_device.h:78:2: warning: format specifies type 'unsigned long' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
78 | VFIO_ASSERT_NE(r, -1, "F_GETFL failed for fd %d\n", fd);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:33:37: note: expanded from macro 'VFIO_ASSERT_NE'
33 | #define VFIO_ASSERT_NE(_a, _b, ...) VFIO_ASSERT_OP(_a, _b, !=, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:27:22: note: expanded from macro 'VFIO_ASSERT_OP'
26 | fprintf(stderr, " Observed: %#lx %s %#lx\n", \
| ~~~~
27 | (u64)__lhs, #_op, (u64)__rhs); \
| ^~~~~~~~~~
In file included from tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c:11:
In file included from tools/testing/selftests/vfio/lib/include/libvfio.h:8:
tools/testing/selftests/vfio/lib/include/libvfio/vfio_pci_device.h:81:2: warning: format specifies type 'unsigned long' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
81 | VFIO_ASSERT_NE(r, -1, "F_SETFL O_NONBLOCK failed for fd %d\n", fd);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:33:37: note: expanded from macro 'VFIO_ASSERT_NE'
33 | #define VFIO_ASSERT_NE(_a, _b, ...) VFIO_ASSERT_OP(_a, _b, !=, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:27:4: note: expanded from macro 'VFIO_ASSERT_OP'
26 | fprintf(stderr, " Observed: %#lx %s %#lx\n", \
| ~~~~
27 | (u64)__lhs, #_op, (u64)__rhs); \
| ^~~~~~~~~~
In file included from tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c:11:
In file included from tools/testing/selftests/vfio/lib/include/libvfio.h:8:
tools/testing/selftests/vfio/lib/include/libvfio/vfio_pci_device.h:81:2: warning: format specifies type 'unsigned long' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
81 | VFIO_ASSERT_NE(r, -1, "F_SETFL O_NONBLOCK failed for fd %d\n", fd);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:33:37: note: expanded from macro 'VFIO_ASSERT_NE'
33 | #define VFIO_ASSERT_NE(_a, _b, ...) VFIO_ASSERT_OP(_a, _b, !=, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:27:22: note: expanded from macro 'VFIO_ASSERT_OP'
26 | fprintf(stderr, " Observed: %#lx %s %#lx\n", \
| ~~~~
27 | (u64)__lhs, #_op, (u64)__rhs); \
| ^~~~~~~~~~
>> tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c:102:3: warning: format specifies type 'unsigned long' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
102 | VFIO_ASSERT_NE(__iommu_map(iommu, ®ion), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:33:37: note: expanded from macro 'VFIO_ASSERT_NE'
33 | #define VFIO_ASSERT_NE(_a, _b, ...) VFIO_ASSERT_OP(_a, _b, !=, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:27:4: note: expanded from macro 'VFIO_ASSERT_OP'
26 | fprintf(stderr, " Observed: %#lx %s %#lx\n", \
| ~~~~
27 | (u64)__lhs, #_op, (u64)__rhs); \
| ^~~~~~~~~~
>> tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c:102:3: warning: format specifies type 'unsigned long' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
102 | VFIO_ASSERT_NE(__iommu_map(iommu, ®ion), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:33:37: note: expanded from macro 'VFIO_ASSERT_NE'
33 | #define VFIO_ASSERT_NE(_a, _b, ...) VFIO_ASSERT_OP(_a, _b, !=, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:27:22: note: expanded from macro 'VFIO_ASSERT_OP'
26 | fprintf(stderr, " Observed: %#lx %s %#lx\n", \
| ~~~~
27 | (u64)__lhs, #_op, (u64)__rhs); \
| ^~~~~~~~~~
tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c:103:3: warning: format specifies type 'unsigned long' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
103 | VFIO_ASSERT_NE(__iommu_unmap(iommu, ®ion, NULL), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:33:37: note: expanded from macro 'VFIO_ASSERT_NE'
33 | #define VFIO_ASSERT_NE(_a, _b, ...) VFIO_ASSERT_OP(_a, _b, !=, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:27:4: note: expanded from macro 'VFIO_ASSERT_OP'
26 | fprintf(stderr, " Observed: %#lx %s %#lx\n", \
| ~~~~
27 | (u64)__lhs, #_op, (u64)__rhs); \
| ^~~~~~~~~~
tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c:103:3: warning: format specifies type 'unsigned long' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
103 | VFIO_ASSERT_NE(__iommu_unmap(iommu, ®ion, NULL), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:33:37: note: expanded from macro 'VFIO_ASSERT_NE'
33 | #define VFIO_ASSERT_NE(_a, _b, ...) VFIO_ASSERT_OP(_a, _b, !=, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:27:22: note: expanded from macro 'VFIO_ASSERT_OP'
26 | fprintf(stderr, " Observed: %#lx %s %#lx\n", \
| ~~~~
27 | (u64)__lhs, #_op, (u64)__rhs); \
| ^~~~~~~~~~
tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c:132:2: warning: format specifies type 'unsigned long' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
132 | VFIO_ASSERT_NE(vaddr, MAP_FAILED);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:33:37: note: expanded from macro 'VFIO_ASSERT_NE'
33 | #define VFIO_ASSERT_NE(_a, _b, ...) VFIO_ASSERT_OP(_a, _b, !=, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:27:4: note: expanded from macro 'VFIO_ASSERT_OP'
26 | fprintf(stderr, " Observed: %#lx %s %#lx\n", \
| ~~~~
27 | (u64)__lhs, #_op, (u64)__rhs); \
| ^~~~~~~~~~
tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c:132:2: warning: format specifies type 'unsigned long' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
132 | VFIO_ASSERT_NE(vaddr, MAP_FAILED);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:33:37: note: expanded from macro 'VFIO_ASSERT_NE'
33 | #define VFIO_ASSERT_NE(_a, _b, ...) VFIO_ASSERT_OP(_a, _b, !=, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:27:22: note: expanded from macro 'VFIO_ASSERT_OP'
26 | fprintf(stderr, " Observed: %#lx %s %#lx\n", \
| ~~~~
27 | (u64)__lhs, #_op, (u64)__rhs); \
| ^~~~~~~~~~
tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c:136:2: warning: format specifies type 'unsigned long' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
136 | VFIO_ASSERT_EQ(munmap(vaddr, size), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:32:37: note: expanded from macro 'VFIO_ASSERT_EQ'
32 | #define VFIO_ASSERT_EQ(_a, _b, ...) VFIO_ASSERT_OP(_a, _b, ==, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:27:4: note: expanded from macro 'VFIO_ASSERT_OP'
26 | fprintf(stderr, " Observed: %#lx %s %#lx\n", \
| ~~~~
27 | (u64)__lhs, #_op, (u64)__rhs); \
| ^~~~~~~~~~
tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c:136:2: warning: format specifies type 'unsigned long' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
136 | VFIO_ASSERT_EQ(munmap(vaddr, size), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:32:37: note: expanded from macro 'VFIO_ASSERT_EQ'
32 | #define VFIO_ASSERT_EQ(_a, _b, ...) VFIO_ASSERT_OP(_a, _b, ==, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/testing/selftests/vfio/lib/include/libvfio/assert.h:27:22: note: expanded from macro 'VFIO_ASSERT_OP'
26 | fprintf(stderr, " Observed: %#lx %s %#lx\n", \
| ~~~~
27 | (u64)__lhs, #_op, (u64)__rhs); \
| ^~~~~~~~~~18 warnings generated.
vim +102 tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c
82
83 static void do_mmio_map_test(struct iommu *iommu,
84 struct iova_allocator *iova_allocator,
85 void *vaddr, size_t size)
86 {
87 struct dma_region region = {
88 .vaddr = vaddr,
89 .size = size,
90 .iova = iova_allocator_alloc(iova_allocator, size),
91 };
92
93 /*
94 * NOTE: Check for iommufd compat success once it lands. Native iommufd
95 * will never support this.
96 */
97 if (!strcmp(iommu->mode->name, MODE_VFIO_TYPE1V2_IOMMU) ||
98 !strcmp(iommu->mode->name, MODE_VFIO_TYPE1_IOMMU)) {
99 iommu_map(iommu, ®ion);
100 iommu_unmap(iommu, ®ion);
101 } else {
> 102 VFIO_ASSERT_NE(__iommu_map(iommu, ®ion), 0); 103 VFIO_ASSERT_NE(__iommu_unmap(iommu, ®ion, NULL), 0);
104 }
105 }
106
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki