From: kbuild test robot <lkp@intel.com>
To: Mike Rapoport <rppt@linux.ibm.com>
Cc: kbuild-all@01.org, Johannes Weiner <hannes@cmpxchg.org>,
Guo Ren <ren_guo@c-sky.com>, Juergen Gross <jgross@suse.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>
Subject: [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'}
Date: Thu, 31 Jan 2019 22:13:03 +0800 [thread overview]
Message-ID: <201901312201.xeJQkQtY%fengguang.wu@intel.com> (raw)
[-- 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 --]
reply other threads:[~2019-01-31 14:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201901312201.xeJQkQtY%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=geert@linux-m68k.org \
--cc=hannes@cmpxchg.org \
--cc=jgross@suse.com \
--cc=kbuild-all@01.org \
--cc=linux-mm@kvack.org \
--cc=ren_guo@c-sky.com \
--cc=rppt@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).