Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [sbates130272-p2pmem:dev/amd-dma-buf 3/3] drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:412: warning: Function parameter or struct member 'dmabuf' not described in 'amdgpu_dma_buf_rw_file'
@ 2025-06-03  0:50 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-06-03  0:50 UTC (permalink / raw)
  To: Stephen Bates; +Cc: llvm, oe-kbuild-all

tree:   https://github.com/sbates130272/linux-p2pmem.git dev/amd-dma-buf
head:   bbb07dc00a3bb220aa0570177a0716d7b48bac7e
commit: bbb07dc00a3bb220aa0570177a0716d7b48bac7e [3/3] amdgpu_dma_buf: Add a rwfile dma_buf callback for file IO.
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250603/202506030816.1uTP3kcg-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
rustc: rustc 1.78.0 (9b00956e5 2024-04-29)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250603/202506030816.1uTP3kcg-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/202506030816.1uTP3kcg-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:412: warning: Function parameter or struct member 'dmabuf' not described in 'amdgpu_dma_buf_rw_file'
>> drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:412: warning: Function parameter or struct member 'back' not described in 'amdgpu_dma_buf_rw_file'
>> drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:412: warning: Excess function parameter 'dma_buf' description in 'amdgpu_dma_buf_rw_file'
>> drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:412: warning: Excess function parameter 'dma_buf_rw_file' description in 'amdgpu_dma_buf_rw_file'


vim +412 drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c

   395	
   396	/**
   397	 * amdgpu_dma_buf_rw_file - &dma_buf_ops.rw_file implementation
   398	 * @dma_buf: Shared DMA buffer
   399	 * @dma_buf_rw_file: Struct with info on backing file
   400	 *
   401	 * This is a callback to enable both buffered and O_DIRECT IO between
   402	 * an AMD GPU generated dma_buf and a file on any standard (VFS
   403	 * supported) filesystem. Note that the backing-object associated with
   404	 * the dma-buf is managed by this driver and thus this driver has full
   405	 * control over the location and mappings.
   406	 *
   407	 * Returns:
   408	 * 0 on success or a negative error code on failure.
   409	 */
   410	static int amdgpu_dma_buf_rw_file(struct dma_buf *dmabuf,
   411	                                  struct dma_buf_rw_file *back)
 > 412	{
   413		int ret = 0;
   414		__u32 op = back->flags & DMA_BUF_RW_FLAGS_OP_MASK;
   415		bool direct_io = back->flags & DMA_BUF_RW_FLAGS_DIRECT;
   416		struct file *filp;
   417	
   418		if (op != DMA_BUF_RW_FLAGS_READ && op != DMA_BUF_RW_FLAGS_WRITE)
   419			return -EINVAL;
   420		if (direct_io) {
   421			if (!PAGE_ALIGNED(back->file_offset) ||
   422			    !PAGE_ALIGNED(back->buf_offset) ||
   423			    !PAGE_ALIGNED(back->buf_len))
   424				return -EINVAL;
   425		}
   426		if (!back->buf_len || back->buf_len > dmabuf->size ||
   427			back->buf_offset >= dmabuf->size ||
   428			back->buf_offset + back->buf_len > dmabuf->size)
   429			return -EINVAL;
   430		if (back->file_offset + back->buf_len < back->file_offset)
   431			return -EINVAL;
   432	
   433		filp = fget(back->fd);
   434		if (!filp)
   435			return -EBADF;
   436	
   437		ret = amdgpu_rw_file(dmabuf, op == DMA_BUF_RW_FLAGS_READ,
   438				     direct_io, filp, back->file_offset,
   439				     back->buf_offset, back->buf_len);
   440	
   441		fput(filp);
   442		return ret;
   443	}
   444	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* [sbates130272-p2pmem:dev/amd-dma-buf 3/3] drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:412: warning: Function parameter or struct member 'dmabuf' not described in 'amdgpu_dma_buf_rw_file'
@ 2025-06-03 17:44 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-06-03 17:44 UTC (permalink / raw)
  To: Stephen Bates; +Cc: llvm, oe-kbuild-all

tree:   https://github.com/sbates130272/linux-p2pmem.git dev/amd-dma-buf
head:   bbb07dc00a3bb220aa0570177a0716d7b48bac7e
commit: bbb07dc00a3bb220aa0570177a0716d7b48bac7e [3/3] amdgpu_dma_buf: Add a rwfile dma_buf callback for file IO.
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250604/202506040309.Ly2VPBjS-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250604/202506040309.Ly2VPBjS-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/202506040309.Ly2VPBjS-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:412: warning: Function parameter or struct member 'dmabuf' not described in 'amdgpu_dma_buf_rw_file'
>> drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:412: warning: Function parameter or struct member 'back' not described in 'amdgpu_dma_buf_rw_file'
>> drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:412: warning: Excess function parameter 'dma_buf' description in 'amdgpu_dma_buf_rw_file'
>> drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:412: warning: Excess function parameter 'dma_buf_rw_file' description in 'amdgpu_dma_buf_rw_file'


vim +412 drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c

   395	
   396	/**
   397	 * amdgpu_dma_buf_rw_file - &dma_buf_ops.rw_file implementation
   398	 * @dma_buf: Shared DMA buffer
   399	 * @dma_buf_rw_file: Struct with info on backing file
   400	 *
   401	 * This is a callback to enable both buffered and O_DIRECT IO between
   402	 * an AMD GPU generated dma_buf and a file on any standard (VFS
   403	 * supported) filesystem. Note that the backing-object associated with
   404	 * the dma-buf is managed by this driver and thus this driver has full
   405	 * control over the location and mappings.
   406	 *
   407	 * Returns:
   408	 * 0 on success or a negative error code on failure.
   409	 */
   410	static int amdgpu_dma_buf_rw_file(struct dma_buf *dmabuf,
   411	                                  struct dma_buf_rw_file *back)
 > 412	{
   413		int ret = 0;
   414		__u32 op = back->flags & DMA_BUF_RW_FLAGS_OP_MASK;
   415		bool direct_io = back->flags & DMA_BUF_RW_FLAGS_DIRECT;
   416		struct file *filp;
   417	
   418		if (op != DMA_BUF_RW_FLAGS_READ && op != DMA_BUF_RW_FLAGS_WRITE)
   419			return -EINVAL;
   420		if (direct_io) {
   421			if (!PAGE_ALIGNED(back->file_offset) ||
   422			    !PAGE_ALIGNED(back->buf_offset) ||
   423			    !PAGE_ALIGNED(back->buf_len))
   424				return -EINVAL;
   425		}
   426		if (!back->buf_len || back->buf_len > dmabuf->size ||
   427			back->buf_offset >= dmabuf->size ||
   428			back->buf_offset + back->buf_len > dmabuf->size)
   429			return -EINVAL;
   430		if (back->file_offset + back->buf_len < back->file_offset)
   431			return -EINVAL;
   432	
   433		filp = fget(back->fd);
   434		if (!filp)
   435			return -EBADF;
   436	
   437		ret = amdgpu_rw_file(dmabuf, op == DMA_BUF_RW_FLAGS_READ,
   438				     direct_io, filp, back->file_offset,
   439				     back->buf_offset, back->buf_len);
   440	
   441		fput(filp);
   442		return ret;
   443	}
   444	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2025-06-03 17:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-03  0:50 [sbates130272-p2pmem:dev/amd-dma-buf 3/3] drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:412: warning: Function parameter or struct member 'dmabuf' not described in 'amdgpu_dma_buf_rw_file' kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2025-06-03 17:44 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox