Re: [PATCH 3/6] dmatest: move printing to its own routine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Luis,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.15-rc7 next-20250521]
[cannot apply to vkoul-dmaengine/next shuah-kselftest/next shuah-kselftest/fixes sysctl/sysctl-next]
[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/Luis-Chamberlain/fake-dma-add-fake-dma-engine-driver/20250521-064035
base:   linus/master
patch link:    https://lore.kernel.org/r/20250520223913.3407136-4-mcgrof%40kernel.org
patch subject: [PATCH 3/6] dmatest: move printing to its own routine
config: sparc-allmodconfig (https://download.01.org/0day-ci/archive/20250522/202505220605.kiB8N7DJ-lkp@xxxxxxxxx/config)
compiler: sparc64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250522/202505220605.kiB8N7DJ-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505220605.kiB8N7DJ-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   drivers/dma/dmatest.c: In function 'dmatest_func':
>> drivers/dma/dmatest.c:957:17: warning: variable 'start_time' set but not used [-Wunused-but-set-variable]
     957 |         ktime_t start_time, streaming_start;
         |                 ^~~~~~~~~~


vim +/start_time +957 drivers/dma/dmatest.c

   932	
   933	/*
   934	 * This function repeatedly tests DMA transfers of various lengths and
   935	 * offsets for a given operation type until it is told to exit by
   936	 * kthread_stop(). There may be multiple threads running this function
   937	 * in parallel for a single channel, and there may be multiple channels
   938	 * being tested in parallel.
   939	 *
   940	 * Before each test, the source and destination buffer is initialized
   941	 * with a known pattern. This pattern is different depending on
   942	 * whether it's in an area which is supposed to be copied or
   943	 * overwritten, and different in the source and destination buffers.
   944	 * So if the DMA engine doesn't copy exactly what we tell it to copy,
   945	 * we'll notice.
   946	 */
   947	static int dmatest_func(void *data)
   948	{
   949		struct dmatest_thread *thread = data;
   950		struct dmatest_info *info = thread->info;
   951		struct dmatest_params *params = &info->params;
   952		struct dma_chan *chan = thread->chan;
   953		unsigned int buf_size;
   954		u8 align;
   955		bool is_memset;
   956		unsigned int total_iterations = 0;
 > 957		ktime_t start_time, streaming_start;
   958		ktime_t filltime = 0;
   959		ktime_t comparetime = 0;
   960		int ret;
   961	
   962		set_freezable();
   963		smp_rmb();
   964		thread->pending = false;
   965	
   966		/* Initialize statistics */
   967		thread->streaming_tests = 0;
   968		thread->streaming_failures = 0;
   969		thread->streaming_total_len = 0;
   970		thread->streaming_runtime = 0;
   971	
   972		/* Setup test parameters and allocate buffers */
   973		ret = dmatest_setup_test(thread, &buf_size, &align, &is_memset);
   974		if (ret)
   975			goto err_thread_type;
   976	
   977		set_user_nice(current, 10);
   978	
   979		start_time = ktime_get();
   980		while (!(kthread_should_stop() ||
   981			(params->iterations && total_iterations >= params->iterations))) {
   982	
   983			/* Test streaming DMA path */
   984			streaming_start = ktime_get();
   985			ret = dmatest_do_dma_test(thread, buf_size, align, is_memset,
   986						  &thread->streaming_tests, &thread->streaming_failures,
   987						  &thread->streaming_total_len,
   988						  &filltime, &comparetime);
   989			thread->streaming_runtime = ktime_add(thread->streaming_runtime,
   990							    ktime_sub(ktime_get(), streaming_start));
   991			if (ret < 0)
   992				break;
   993	
   994			total_iterations++;
   995		}
   996	
   997		/* Subtract fill and compare time from both paths */
   998		thread->streaming_runtime = ktime_sub(thread->streaming_runtime,
   999						   ktime_divns(filltime, 2));
  1000		thread->streaming_runtime = ktime_sub(thread->streaming_runtime,
  1001						   ktime_divns(comparetime, 2));
  1002	
  1003		ret = 0;
  1004		dmatest_cleanup_test(thread);
  1005	
  1006	err_thread_type:
  1007		/* Print detailed statistics */
  1008		dmatest_print_detailed_stats(thread);
  1009	
  1010		/* terminate all transfers on specified channels */
  1011		if (ret || (thread->streaming_failures))
  1012			dmaengine_terminate_sync(chan);
  1013	
  1014		thread->done = true;
  1015		wake_up(&thread_wait);
  1016	
  1017		return ret;
  1018	}
  1019	

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




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux