drivers/staging/media/atomisp/pci/hmm/hmm.c:269:6: warning: format '%ld' expects argument of type 'long int', but argument 6 has type 'size_t' {aka 'unsigned int'}
From: kernel test robot
Date: Wed Jul 29 2020 - 17:27:03 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 6ba1b005ffc388c2aeaddae20da29e4810dea298
commit: 03884c93560c48c2739caa9b104b0cb4d3ea8c91 media: atomisp: add debug for hmm alloc
date: 7 weeks ago
config: i386-randconfig-r016-20200729 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
git checkout 03884c93560c48c2739caa9b104b0cb4d3ea8c91
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
cc1: warning: drivers/staging/media/atomisp//pci/hive_isp_css_include/memory_access/: No such file or directory [-Wmissing-include-dirs]
In file included from include/linux/device.h:15,
from include/linux/acpi.h:15,
from include/linux/i2c.h:13,
from drivers/staging/media/atomisp//include/hmm/../../include/linux/atomisp_platform.h:20,
from drivers/staging/media/atomisp//pci/atomisp_internal.h:22,
from drivers/staging/media/atomisp/pci/hmm/hmm.c:33:
drivers/staging/media/atomisp/pci/hmm/hmm.c: In function 'hmm_alloc':
>> drivers/staging/media/atomisp/pci/hmm/hmm.c:269:6: warning: format '%ld' expects argument of type 'long int', but argument 6 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
269 | "%s: pages: 0x%08x (%ld bytes), type: %d from highmem %d, user ptr %p, cached %d\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/staging/media/atomisp/pci/hmm/hmm.c:268:6: note: in expansion of macro 'dev_dbg'
268 | dev_dbg(atomisp_dev,
| ^~~~~~~
drivers/staging/media/atomisp/pci/hmm/hmm.c:269:28: note: format string is defined here
269 | "%s: pages: 0x%08x (%ld bytes), type: %d from highmem %d, user ptr %p, cached %d\n",
| ~~^
| |
| long int
| %d
vim +269 drivers/staging/media/atomisp/pci/hmm/hmm.c
220
221 ia_css_ptr hmm_alloc(size_t bytes, enum hmm_bo_type type,
222 int from_highmem, const void __user *userptr,
223 const uint16_t attrs)
224 {
225 unsigned int pgnr;
226 struct hmm_buffer_object *bo;
227 bool cached = attrs & ATOMISP_MAP_FLAG_CACHED;
228 int ret;
229
230 WARN_ON(attrs & ATOMISP_MAP_FLAG_CONTIGUOUS);
231
232 /*
233 * Check if we are initialized. In the ideal world we wouldn't need
234 * this but we can tackle it once the driver is a lot cleaner
235 */
236
237 if (!hmm_initialized)
238 hmm_init();
239 /* Get page number from size */
240 pgnr = size_to_pgnr_ceil(bytes);
241
242 /* Buffer object structure init */
243 bo = hmm_bo_alloc(&bo_device, pgnr);
244 if (!bo) {
245 dev_err(atomisp_dev, "hmm_bo_create failed.\n");
246 goto create_bo_err;
247 }
248
249 /* Allocate pages for memory */
250 ret = hmm_bo_alloc_pages(bo, type, from_highmem, userptr, cached);
251 if (ret) {
252 dev_err(atomisp_dev, "hmm_bo_alloc_pages failed.\n");
253 goto alloc_page_err;
254 }
255
256 /* Combine the virtual address and pages together */
257 ret = hmm_bo_bind(bo);
258 if (ret) {
259 dev_err(atomisp_dev, "hmm_bo_bind failed.\n");
260 goto bind_err;
261 }
262
263 hmm_mem_stat.tol_cnt += pgnr;
264
265 if (attrs & ATOMISP_MAP_FLAG_CLEARED)
266 hmm_set(bo->start, 0, bytes);
267
268 dev_dbg(atomisp_dev,
> 269 "%s: pages: 0x%08x (%ld bytes), type: %d from highmem %d, user ptr %p, cached %d\n",
270 __func__, bo->start, bytes, type, from_highmem, userptr, cached);
271
272 return bo->start;
273
274 bind_err:
275 hmm_bo_free_pages(bo);
276 alloc_page_err:
277 hmm_bo_unref(bo);
278 create_bo_err:
279 return 0;
280 }
281
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip