kernel/kexec_file.c:661:45: warning: format specifies type 'int' but the argument has type 'unsigned long'
kernel test robot
build bottree: https://github.com/agraf/linux-2.6.git kexec-cma head: 752619bbe38c535612b1a9e5b47ea7d962c63449 commit: 752619bbe38c535612b1a9e5b47ea7d962c63449 [2/2] XXX config: x86_64-buildonly-randconfig-001-20250510 (https://download.01.org/0day-ci/archive/20250510/[email protected]/config) compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250510/[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 >>):
>> kernel/kexec_file.c:661:45: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
661 | pr_warn("Allocated %d pages DMA memory\n", kbuf->memsz >> PAGE_SHIFT);
| ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
| %lu
include/linux/printk.h:560:37: note: expanded from macro 'pr_warn'
560 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
| ~~~ ^~~~~~~~~~~
include/linux/printk.h:507:60: note: expanded from macro 'printk'
507 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
| ~~~ ^~~~~~~~~~~
include/linux/printk.h:479:19: note: expanded from macro 'printk_index_wrap'
479 | _p_func(_fmt, ##__VA_ARGS__); \
| ~~~~ ^~~~~~~~~~~1 warning generated.
vim +661 kernel/kexec_file.c
635
636 static int kexec_alloc_contig(struct kexec_buf *kbuf)
637 {
638 struct page *p;
639 unsigned long mem;
640 u32 i;
641
642 p = dma_alloc_from_contiguous(NULL, kbuf->memsz >> PAGE_SHIFT,
643 get_order(kbuf->buf_align), true);
644
645 if (!p)
646 return -EADDRNOTAVAIL;
647
648 /* Add the relevant pages to our dest_pages list so we find them later */
649 for (i = 0; i < kbuf->memsz >> PAGE_SHIFT; i++)
650 list_add(&p[i].lru, &kbuf->image->dest_pages);
651
652 mem = page_to_boot_pfn(p) << PAGE_SHIFT;
653
654 if (kimage_is_destination_range(kbuf->image, mem, mem + kbuf->memsz)) {
655 /* Our region is already in use by a statically defined one. Bail out. */
656 pr_warn("kexec: CMA overlaps existing mem: 0x%lx+0x%lx\n", mem, kbuf->memsz);
657 return -EADDRNOTAVAIL;
658 }
659
660 kbuf->mem = page_to_boot_pfn(p) << PAGE_SHIFT;
> 661 pr_warn("Allocated %d pages DMA memory\n", kbuf->memsz >> PAGE_SHIFT); 662
663 return 0;
664 }
665
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki