From: kernel test robot <lkp@intel.com>
To: Vivek Kasireddy <vivek.kasireddy@intel.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [vivek-drm-tip:virtgpu_import_rfc 9/9] drivers/dma-buf/udmabuf.c:347:24: error: incompatible integer to pointer conversion passing 'unsigned long' to parameter of type 'const void *'
Date: Mon, 1 Apr 2024 20:56:07 +0800 [thread overview]
Message-ID: <202404012015.zh49v9wj-lkp@intel.com> (raw)
tree: https://gitlab.freedesktop.org/Vivek/drm-tip.git virtgpu_import_rfc
head: 2347bf8ba6d850818b830aa54bb75d4b892fb6a8
commit: 2347bf8ba6d850818b830aa54bb75d4b892fb6a8 [9/9] udmabuf: Implement UDMABUF_CREATE_LIST_FOR_PCIDEV ioctl
config: arm-randconfig-002-20240401 (https://download.01.org/0day-ci/archive/20240401/202404012015.zh49v9wj-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 546dc2245ffc4cccd0b05b58b7a5955e355a3b27)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240401/202404012015.zh49v9wj-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404012015.zh49v9wj-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/dma-buf/udmabuf.c:4:
In file included from include/linux/dma-buf.h:19:
In file included from include/linux/scatterlist.h:8:
In file included from include/linux/mm.h:2188:
include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
>> drivers/dma-buf/udmabuf.c:347:24: error: incompatible integer to pointer conversion passing 'unsigned long' to parameter of type 'const void *' [-Wint-conversion]
347 | page = virt_to_page((unsigned long)addr + size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm/include/asm/memory.h:390:53: note: expanded from macro 'virt_to_page'
390 | #define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
| ^~~~~
include/asm-generic/memory_model.h:18:41: note: expanded from macro '__pfn_to_page'
18 | #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET))
| ^~~
arch/arm/include/asm/memory.h:296:53: note: passing argument to parameter 'p' here
296 | static inline unsigned long virt_to_pfn(const void *p)
| ^
drivers/dma-buf/udmabuf.c:565:9: warning: shift count >= width of type [-Wshift-count-overflow]
565 | DMA_BIT_MASK(64));
| ^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:77:54: note: expanded from macro 'DMA_BIT_MASK'
77 | #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
| ^ ~~~
2 warnings and 1 error generated.
vim +347 drivers/dma-buf/udmabuf.c
299
300 static int handle_pcidev_pages(struct udmabuf *ubuf,
301 struct udmabuf_create_list *head,
302 struct udmabuf_create_item *list)
303 {
304 struct pci_dev *pdev = NULL;
305 resource_size_t bar_size;
306 pgoff_t pgbuf = 0;
307 struct page *page;
308 int i, ret;
309 size_t size;
310 void *addr;
311
312 for (i = 0; i < head->count; i++) {
313 if (!ubuf->pdev) {
314 pdev = pci_get_domain_bus_and_slot(0,
315 PCI_BUS_NUM(list[i].devid),
316 list[i].devid & 0xff);
317 if (!pdev) {
318 ret = -ENODEV;
319 goto err;
320 }
321
322 ubuf->pdev = pdev;
323 }
324
325 bar_size = pci_resource_len(pdev, list[i].bar);
326 if (list[i].offset > bar_size ||
327 list[i].offset + list[i].size > bar_size) {
328 ret = -EINVAL;
329 goto err;
330 }
331
332 ret = pci_p2pdma_add_resource(pdev,
333 list[i].bar,
334 list[i].size,
335 list[i].offset);
336 if (ret)
337 goto err;
338
339 addr = pci_alloc_p2pmem(pdev, list[i].size);
340 if (!addr) {
341 ret = -EINVAL;
342 goto err;
343 }
344
345 size = 0;
346 while (size < list[i].size) {
> 347 page = virt_to_page((unsigned long)addr + size);
348 ubuf->pages[pgbuf++] = page;
349
350 size += PAGE_SIZE;
351 }
352 }
353
354 err:
355 while (pgbuf > 0 && ubuf->pages[--pgbuf])
356 pci_free_p2pmem(pdev,
357 page_to_virt(ubuf->pages[pgbuf]),
358 PAGE_SIZE);
359 if (pdev)
360 pci_dev_put(pdev);
361 return ret;
362 }
363
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-04-01 12:56 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=202404012015.zh49v9wj-lkp@intel.com \
--to=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=vivek.kasireddy@intel.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