* [mmotm:master 292/305] kernel/dma/swiotlb.c:210:35: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'}
@ 2019-01-31 13:55 kbuild test robot
0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-01-31 13:55 UTC (permalink / raw)
To: Mike Rapoport
Cc: kbuild-all, Johannes Weiner, Andrew Morton, Linux Memory Management List
[-- Attachment #1: Type: text/plain, Size: 3037 bytes --]
tree: git://git.cmpxchg.org/linux-mmotm.git master
head: a4186de8d65ec2ca6c39070ef1d6795a0b4ffe04
commit: ed3a4b0e077d27416ac3f9bb37ee64e59f73b088 [292/305] swiotlb: add checks for the return value of memblock_alloc*()
config: i386-allmodconfig (attached as .config)
compiler: gcc-8 (Debian 8.2.0-14) 8.2.0
reproduce:
git checkout ed3a4b0e077d27416ac3f9bb37ee64e59f73b088
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
kernel/dma/swiotlb.c: In function 'swiotlb_init_with_tbl':
>> kernel/dma/swiotlb.c:210:35: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
~~^
%u
__func__, alloc_size, PAGE_SIZE);
~~~~~~~~~~
kernel/dma/swiotlb.c:216:35: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
~~^
%u
__func__, alloc_size, PAGE_SIZE);
~~~~~~~~~~
vim +210 kernel/dma/swiotlb.c
190
191 int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose)
192 {
193 unsigned long i, bytes;
194 size_t alloc_size;
195
196 bytes = nslabs << IO_TLB_SHIFT;
197
198 io_tlb_nslabs = nslabs;
199 io_tlb_start = __pa(tlb);
200 io_tlb_end = io_tlb_start + bytes;
201
202 /*
203 * Allocate and initialize the free list array. This array is used
204 * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE
205 * between io_tlb_start and io_tlb_end.
206 */
207 alloc_size = PAGE_ALIGN(io_tlb_nslabs * sizeof(int));
208 io_tlb_list = memblock_alloc(alloc_size, PAGE_SIZE);
209 if (!io_tlb_list)
> 210 panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
211 __func__, alloc_size, PAGE_SIZE);
212
213 alloc_size = PAGE_ALIGN(io_tlb_nslabs * sizeof(phys_addr_t));
214 io_tlb_orig_addr = memblock_alloc(alloc_size, PAGE_SIZE);
215 if (!io_tlb_orig_addr)
216 panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
217 __func__, alloc_size, PAGE_SIZE);
218
219 for (i = 0; i < io_tlb_nslabs; i++) {
220 io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE);
221 io_tlb_orig_addr[i] = INVALID_PHYS_ADDR;
222 }
223 io_tlb_index = 0;
224
225 if (verbose)
226 swiotlb_print_info();
227
228 swiotlb_set_max_segment(io_tlb_nslabs << IO_TLB_SHIFT);
229 return 0;
230 }
231
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 66830 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-01-31 13:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-31 13:55 [mmotm:master 292/305] kernel/dma/swiotlb.c:210:35: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} kbuild test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox