All of lore.kernel.org
 help / color / mirror / Atom feed
* [xlnx:master 40/56] drivers/misc/xilinx-ai-engine/ai-engine-mem.c:109:6: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'phys_addr_t' {aka 'unsigned int'}
@ 2020-07-08 17:51 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-07-08 17:51 UTC (permalink / raw)
  To: Wendy Liang; +Cc: Michal Simek, kbuild-all, Hyun Kwon, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 4484 bytes --]

tree:   https://github.com/Xilinx/linux-xlnx master
head:   1f632afa6e678d975f83ed99b2602e8eed5e3729
commit: f229a4cf0b8d8134828e98ec54cd7f35dba99182 [40/56] misc: xilinx-ai-engine: export AI engine program and data memory to userspace
config: nios2-allyesconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout f229a4cf0b8d8134828e98ec54cd7f35dba99182
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nios2 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/dma-mapping.h:7,
                    from include/linux/dma-buf.h:20,
                    from drivers/misc/xilinx-ai-engine/ai-engine-mem.c:8:
   drivers/misc/xilinx-ai-engine/ai-engine-mem.c: In function 'aie_mem_mmap':
>> drivers/misc/xilinx-ai-engine/ai-engine-mem.c:109:6: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'phys_addr_t' {aka 'unsigned int'} [-Wformat=]
     109 |      "failed to mmap (%u,%u)memory, remap failed, 0x%llx, 0x%lx.\n",
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/device.h:1658:22: note: in definition of macro 'dev_fmt'
    1658 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/misc/xilinx-ai-engine/ai-engine-mem.c:108:5: note: in expansion of macro 'dev_err'
     108 |     dev_err(&apart->dev,
         |     ^~~~~~~
   drivers/misc/xilinx-ai-engine/ai-engine-mem.c:109:56: note: format string is defined here
     109 |      "failed to mmap (%u,%u)memory, remap failed, 0x%llx, 0x%lx.\n",
         |                                                     ~~~^
         |                                                        |
         |                                                        long long unsigned int
         |                                                     %x

vim +109 drivers/misc/xilinx-ai-engine/ai-engine-mem.c

    59	
    60	static int aie_mem_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma)
    61	{
    62		struct aie_part_mem *pmem = dmabuf->priv;
    63		struct aie_mem *mem = &pmem->mem;
    64		struct aie_partition *apart = pmem->apart;
    65		struct aie_location loc;
    66		unsigned long addr = vma->vm_start;
    67		unsigned long offset = vma->vm_pgoff * PAGE_SIZE, moffset = 0;
    68		unsigned long remainder = vma->vm_end - addr;
    69		size_t msize = mem->size;
    70	
    71		if (remainder + offset > pmem->size)
    72			return -EINVAL;
    73	
    74		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
    75		for (loc.col = mem->range.start.col;
    76		     loc.col < mem->range.start.col + mem->range.size.col; loc.col++) {
    77			for (loc.row = mem->range.start.row;
    78			     loc.row < mem->range.start.row + mem->range.size.row;
    79			     loc.row++) {
    80				unsigned long toffset, len;
    81				phys_addr_t mempa;
    82				int ret;
    83	
    84				remainder = vma->vm_end - addr;
    85				if (!remainder)
    86					return 0;
    87	
    88				if (moffset + msize < offset) {
    89					moffset += msize;
    90					continue;
    91				}
    92				/*
    93				 * calculate offset within the tile memory.
    94				 * offset is the offset to vma->start.
    95				 * moffset is the tile memory start offset to
    96				 * vma->start.
    97				 */
    98				toffset = offset - moffset;
    99				len = msize - toffset;
   100				if (len > remainder)
   101					len = remainder;
   102				mempa = aie_cal_reg_pa(apart->adev, loc,
   103						       toffset + mem->offset);
   104	
   105				ret = remap_pfn_range(vma, addr, mempa >> PAGE_SHIFT,
   106						      len, vma->vm_page_prot);
   107				if (ret) {
   108					dev_err(&apart->dev,
 > 109						"failed to mmap (%u,%u)memory, remap failed, 0x%llx, 0x%lx.\n",
   110						loc.col, loc.row, mempa, len);
   111					return ret;
   112				}
   113				addr += len;
   114				offset += len;
   115				moffset += msize;
   116			}
   117		}
   118		return 0;
   119	}
   120	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 51476 bytes --]

[-- Attachment #3: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [xlnx:master 40/56] drivers/misc/xilinx-ai-engine/ai-engine-mem.c:109:6: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'phys_addr_t' {aka 'unsigned int'}
@ 2020-07-08 17:51 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-07-08 17:51 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4591 bytes --]

tree:   https://github.com/Xilinx/linux-xlnx master
head:   1f632afa6e678d975f83ed99b2602e8eed5e3729
commit: f229a4cf0b8d8134828e98ec54cd7f35dba99182 [40/56] misc: xilinx-ai-engine: export AI engine program and data memory to userspace
config: nios2-allyesconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout f229a4cf0b8d8134828e98ec54cd7f35dba99182
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nios2 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/dma-mapping.h:7,
                    from include/linux/dma-buf.h:20,
                    from drivers/misc/xilinx-ai-engine/ai-engine-mem.c:8:
   drivers/misc/xilinx-ai-engine/ai-engine-mem.c: In function 'aie_mem_mmap':
>> drivers/misc/xilinx-ai-engine/ai-engine-mem.c:109:6: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'phys_addr_t' {aka 'unsigned int'} [-Wformat=]
     109 |      "failed to mmap (%u,%u)memory, remap failed, 0x%llx, 0x%lx.\n",
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/device.h:1658:22: note: in definition of macro 'dev_fmt'
    1658 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/misc/xilinx-ai-engine/ai-engine-mem.c:108:5: note: in expansion of macro 'dev_err'
     108 |     dev_err(&apart->dev,
         |     ^~~~~~~
   drivers/misc/xilinx-ai-engine/ai-engine-mem.c:109:56: note: format string is defined here
     109 |      "failed to mmap (%u,%u)memory, remap failed, 0x%llx, 0x%lx.\n",
         |                                                     ~~~^
         |                                                        |
         |                                                        long long unsigned int
         |                                                     %x

vim +109 drivers/misc/xilinx-ai-engine/ai-engine-mem.c

    59	
    60	static int aie_mem_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma)
    61	{
    62		struct aie_part_mem *pmem = dmabuf->priv;
    63		struct aie_mem *mem = &pmem->mem;
    64		struct aie_partition *apart = pmem->apart;
    65		struct aie_location loc;
    66		unsigned long addr = vma->vm_start;
    67		unsigned long offset = vma->vm_pgoff * PAGE_SIZE, moffset = 0;
    68		unsigned long remainder = vma->vm_end - addr;
    69		size_t msize = mem->size;
    70	
    71		if (remainder + offset > pmem->size)
    72			return -EINVAL;
    73	
    74		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
    75		for (loc.col = mem->range.start.col;
    76		     loc.col < mem->range.start.col + mem->range.size.col; loc.col++) {
    77			for (loc.row = mem->range.start.row;
    78			     loc.row < mem->range.start.row + mem->range.size.row;
    79			     loc.row++) {
    80				unsigned long toffset, len;
    81				phys_addr_t mempa;
    82				int ret;
    83	
    84				remainder = vma->vm_end - addr;
    85				if (!remainder)
    86					return 0;
    87	
    88				if (moffset + msize < offset) {
    89					moffset += msize;
    90					continue;
    91				}
    92				/*
    93				 * calculate offset within the tile memory.
    94				 * offset is the offset to vma->start.
    95				 * moffset is the tile memory start offset to
    96				 * vma->start.
    97				 */
    98				toffset = offset - moffset;
    99				len = msize - toffset;
   100				if (len > remainder)
   101					len = remainder;
   102				mempa = aie_cal_reg_pa(apart->adev, loc,
   103						       toffset + mem->offset);
   104	
   105				ret = remap_pfn_range(vma, addr, mempa >> PAGE_SHIFT,
   106						      len, vma->vm_page_prot);
   107				if (ret) {
   108					dev_err(&apart->dev,
 > 109						"failed to mmap (%u,%u)memory, remap failed, 0x%llx, 0x%lx.\n",
   110						loc.col, loc.row, mempa, len);
   111					return ret;
   112				}
   113				addr += len;
   114				offset += len;
   115				moffset += msize;
   116			}
   117		}
   118		return 0;
   119	}
   120	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 51476 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-08 18:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-08 17:51 [xlnx:master 40/56] drivers/misc/xilinx-ai-engine/ai-engine-mem.c:109:6: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'phys_addr_t' {aka 'unsigned int'} kernel test robot
2020-07-08 17:51 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.