[PATCH 4/4] dmaengine: xilinx: xdma: Support cyclic transfers

kernel test robot lkp at intel.com
Mon Jul 31 07:39:55 PDT 2023


Hi Miquel,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.5-rc4 next-20230731]
[cannot apply to xilinx-xlnx/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Miquel-Raynal/dmaengine-xilinx-xdma-Fix-interrupt-vector-setting/20230731-181620
base:   linus/master
patch link:    https://lore.kernel.org/r/20230731101442.792514-5-miquel.raynal%40bootlin.com
patch subject: [PATCH 4/4] dmaengine: xilinx: xdma: Support cyclic transfers
config: powerpc-randconfig-r026-20230731 (https://download.01.org/0day-ci/archive/20230731/202307312225.9ewyJsVx-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230731/202307312225.9ewyJsVx-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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307312225.9ewyJsVx-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/dma/xilinx/xdma.c:716:6: warning: variable 'desc' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     716 |         if (vd)
         |             ^~
   drivers/dma/xilinx/xdma.c:718:7: note: uninitialized use occurs here
     718 |         if (!desc || !desc->cyclic) {
         |              ^~~~
   drivers/dma/xilinx/xdma.c:716:2: note: remove the 'if' if its condition is always true
     716 |         if (vd)
         |         ^~~~~~~
     717 |                 desc = to_xdma_desc(vd);
         | ~~~~~~~~~~~~~~~~
   drivers/dma/xilinx/xdma.c:703:24: note: initialize the variable 'desc' to silence this warning
     703 |         struct xdma_desc *desc;
         |                               ^
         |                                = NULL
   1 warning generated.


vim +716 drivers/dma/xilinx/xdma.c

   697	
   698	static enum dma_status xdma_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
   699					      struct dma_tx_state *state)
   700	{
   701		struct xdma_chan *xdma_chan = to_xdma_chan(chan);
   702		struct virt_dma_desc *vd;
   703		struct xdma_desc *desc;
   704		enum dma_status ret;
   705		unsigned long flags;
   706		unsigned int period_idx;
   707		u32 residue = 0;
   708	
   709		ret = dma_cookie_status(chan, cookie, state);
   710		if (ret == DMA_COMPLETE || !state)
   711			return ret;
   712	
   713		spin_lock_irqsave(&xdma_chan->vchan.lock, flags);
   714	
   715		vd = vchan_find_desc(&xdma_chan->vchan, cookie);
 > 716		if (vd)
   717			desc = to_xdma_desc(vd);
   718		if (!desc || !desc->cyclic) {
   719			spin_unlock_irqrestore(&xdma_chan->vchan.lock, flags);
   720			return ret;
   721		}
   722	
   723		period_idx = desc->completed_desc_num % desc->periods;
   724		residue = (desc->periods - period_idx) * desc->period_size;
   725	
   726		spin_unlock_irqrestore(&xdma_chan->vchan.lock, flags);
   727	
   728		dma_set_residue(state, residue);
   729	
   730		return ret;
   731	}
   732	

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



More information about the linux-arm-kernel mailing list