Re: [PATCH 4/4] thunderbolt: Improve software receiver lane margining

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

 



Hi Mika,

kernel test robot noticed the following build warnings:

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Mika-Westerberg/thunderbolt-Add-missing-usb4_port_sb_read-to-usb4_port_sw_margin/20240815-001205
base:   https://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git next
patch link:    https://lore.kernel.org/r/20240813110135.2178900-5-mika.westerberg%40linux.intel.com
patch subject: [PATCH 4/4] thunderbolt: Improve software receiver lane margining
config: i386-randconfig-141-20240815 (https://download.01.org/0day-ci/archive/20240816/202408161041.jjzazHm4-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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>
| Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
| Closes: https://lore.kernel.org/r/202408161041.jjzazHm4-lkp@xxxxxxxxx/

smatch warnings:
drivers/thunderbolt/debugfs.c:1014 margining_run_sw() error: uninitialized symbol 'errors'.

vim +/errors +1014 drivers/thunderbolt/debugfs.c

c0188291a5471b R Kannappan     2024-08-13   986  static int margining_run_sw(struct tb_margining *margining,
c0188291a5471b R Kannappan     2024-08-13   987  			    struct usb4_port_margining_params *params)
c0188291a5471b R Kannappan     2024-08-13   988  {
c0188291a5471b R Kannappan     2024-08-13   989  	u32 nsamples = margining->dwell_time / DWELL_SAMPLE_INTERVAL;
c0188291a5471b R Kannappan     2024-08-13   990  	u32 errors;
c0188291a5471b R Kannappan     2024-08-13   991  	int ret, i;
c0188291a5471b R Kannappan     2024-08-13   992  
c0188291a5471b R Kannappan     2024-08-13   993  	ret = usb4_port_sw_margin(margining->port, margining->target, margining->index,
c0188291a5471b R Kannappan     2024-08-13   994  				  params, margining->results);
c0188291a5471b R Kannappan     2024-08-13   995  	if (ret)
c0188291a5471b R Kannappan     2024-08-13   996  		goto out_stop;
c0188291a5471b R Kannappan     2024-08-13   997  
c0188291a5471b R Kannappan     2024-08-13   998  	for (i = 0; i <= nsamples; i++) {
c0188291a5471b R Kannappan     2024-08-13   999  		ret = usb4_port_sw_margin_errors(margining->port, margining->target,
c0188291a5471b R Kannappan     2024-08-13  1000  						 margining->index, &margining->results[1]);
c0188291a5471b R Kannappan     2024-08-13  1001  		if (ret)
c0188291a5471b R Kannappan     2024-08-13  1002  			break;
c0188291a5471b R Kannappan     2024-08-13  1003  
c0188291a5471b R Kannappan     2024-08-13  1004  		if (margining->lanes == USB4_MARGIN_SW_LANE_0)
c0188291a5471b R Kannappan     2024-08-13  1005  			errors = FIELD_GET(USB4_MARGIN_SW_ERR_COUNTER_LANE_0_MASK,
c0188291a5471b R Kannappan     2024-08-13  1006  					   margining->results[1]);
c0188291a5471b R Kannappan     2024-08-13  1007  		else if (margining->lanes == USB4_MARGIN_SW_LANE_1)
c0188291a5471b R Kannappan     2024-08-13  1008  			errors = FIELD_GET(USB4_MARGIN_SW_ERR_COUNTER_LANE_1_MASK,
c0188291a5471b R Kannappan     2024-08-13  1009  					   margining->results[1]);
c0188291a5471b R Kannappan     2024-08-13  1010  		else if (margining->lanes == USB4_MARGIN_SW_ALL_LANES)
c0188291a5471b R Kannappan     2024-08-13  1011  			errors = margining->results[1];

The static checker wants an else statement.

c0188291a5471b R Kannappan     2024-08-13  1012  
c0188291a5471b R Kannappan     2024-08-13  1013  		/* Any errors stop the test */
c0188291a5471b R Kannappan     2024-08-13 @1014  		if (errors)
c0188291a5471b R Kannappan     2024-08-13  1015  			break;
c0188291a5471b R Kannappan     2024-08-13  1016  
c0188291a5471b R Kannappan     2024-08-13  1017  		fsleep(DWELL_SAMPLE_INTERVAL * USEC_PER_MSEC);
c0188291a5471b R Kannappan     2024-08-13  1018  	}
c0188291a5471b R Kannappan     2024-08-13  1019  
c0188291a5471b R Kannappan     2024-08-13  1020  out_stop:
c0188291a5471b R Kannappan     2024-08-13  1021  	/*
c0188291a5471b R Kannappan     2024-08-13  1022  	 * Stop the counters but don't clear them to allow the
c0188291a5471b R Kannappan     2024-08-13  1023  	 * different error counter configurations.
c0188291a5471b R Kannappan     2024-08-13  1024  	 */
c0188291a5471b R Kannappan     2024-08-13  1025  	margining_modify_error_counter(margining, margining->lanes,
c0188291a5471b R Kannappan     2024-08-13  1026  				       USB4_MARGIN_SW_ERROR_COUNTER_STOP);
c0188291a5471b R Kannappan     2024-08-13  1027  	return ret;
c0188291a5471b R Kannappan     2024-08-13  1028  }

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





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux