* [mmotm:master 293/305] arch/x86/platform/olpc/olpc_dt.c:145:36: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'const unsigned int'}
@ 2019-01-31 14:13 kbuild test robot
0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-01-31 14:13 UTC (permalink / raw)
To: Mike Rapoport
Cc: kbuild-all, Johannes Weiner, Guo Ren, Juergen Gross,
Geert Uytterhoeven, Andrew Morton, Linux Memory Management List
[-- Attachment #1: Type: text/plain, Size: 2217 bytes --]
tree: git://git.cmpxchg.org/linux-mmotm.git master
head: a4186de8d65ec2ca6c39070ef1d6795a0b4ffe04
commit: 143cfc886d8275787a78aca1b2aa6053a1f00d3c [293/305] treewide: 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 143cfc886d8275787a78aca1b2aa6053a1f00d3c
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
arch/x86/platform/olpc/olpc_dt.c: In function 'prom_early_alloc':
>> arch/x86/platform/olpc/olpc_dt.c:145:36: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'const unsigned int'} [-Wformat=]
panic("%s: Failed to allocate %lu bytes\n", __func__,
~~^
%u
chunk_size);
~~~~~~~~~~
vim +145 arch/x86/platform/olpc/olpc_dt.c
127
128 void * __init prom_early_alloc(unsigned long size)
129 {
130 static u8 *mem;
131 static size_t free_mem;
132 void *res;
133
134 if (free_mem < size) {
135 const size_t chunk_size = max(PAGE_SIZE, size);
136
137 /*
138 * To mimimize the number of allocations, grab at least
139 * PAGE_SIZE of memory (that's an arbitrary choice that's
140 * fast enough on the platforms we care about while minimizing
141 * wasted bootmem) and hand off chunks of it to callers.
142 */
143 res = memblock_alloc(chunk_size, SMP_CACHE_BYTES);
144 if (!res)
> 145 panic("%s: Failed to allocate %lu bytes\n", __func__,
146 chunk_size);
147 BUG_ON(!res);
148 prom_early_allocated += chunk_size;
149 memset(res, 0, chunk_size);
150 free_mem = chunk_size;
151 mem = res;
152 }
153
154 /* allocate from the local cache */
155 free_mem -= size;
156 res = mem;
157 mem += size;
158 return res;
159 }
160
---
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 14:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-31 14:13 [mmotm:master 293/305] arch/x86/platform/olpc/olpc_dt.c:145:36: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'const 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;
as well as URLs for NNTP newsgroup(s).