public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* Re: [PATCH v2 3/7] wifi: rtw88: add the update channel flow to support setting by parameters
       [not found] <20220809084107.38137-4-pkshih@realtek.com>
@ 2022-08-13  5:54 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-08-13  5:54 UTC (permalink / raw)
  To: Ping-Ke Shih; +Cc: llvm, kbuild-all

Hi Ping-Ke,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on wireless-next/main]
[also build test WARNING on wireless/main linus/master v5.19 next-20220812]
[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/Ping-Ke-Shih/wifi-rtw88-add-proper-mutex-lock-to-safely-access-channel/20220809-164550
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
config: i386-randconfig-a012-20220808 (https://download.01.org/0day-ci/archive/20220813/202208131336.sIxFnpKS-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 5f1c7e2cc5a3c07cbc2412e851a7283c1841f520)
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
        # https://github.com/intel-lab-lkp/linux/commit/3843bb3c07b213146fba1ec4f02a694498228d84
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Ping-Ke-Shih/wifi-rtw88-add-proper-mutex-lock-to-safely-access-channel/20220809-164550
        git checkout 3843bb3c07b213146fba1ec4f02a694498228d84
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/net/wireless/realtek/rtw88/

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

All warnings (new ones prefixed by >>):

>> drivers/net/wireless/realtek/rtw88/main.c:731:2: warning: variable 'primary_channel_idx' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
           default:
           ^~~~~~~
   drivers/net/wireless/realtek/rtw88/main.c:754:39: note: uninitialized use occurs here
           hal->current_primary_channel_index = primary_channel_idx;
                                                ^~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/main.c:687:24: note: initialize the variable 'primary_channel_idx' to silence this warning
           u8 primary_channel_idx;
                                 ^
                                  = '\0'
   1 warning generated.


vim +/primary_channel_idx +731 drivers/net/wireless/realtek/rtw88/main.c

   677	
   678	void rtw_update_channel(struct rtw_dev *rtwdev, u8 center_channel,
   679				u8 primary_channel, enum rtw_supported_band band,
   680				enum rtw_bandwidth bandwidth)
   681	{
   682		enum nl80211_band nl_band = rtw_hw_to_nl80211_band(band);
   683		struct rtw_hal *hal = &rtwdev->hal;
   684		u8 *cch_by_bw = hal->cch_by_bw;
   685		u32 center_freq, primary_freq;
   686		enum rtw_sar_bands sar_band;
   687		u8 primary_channel_idx;
   688	
   689		center_freq = ieee80211_channel_to_frequency(center_channel, nl_band);
   690		primary_freq = ieee80211_channel_to_frequency(primary_channel, nl_band);
   691	
   692		/* assign the center channel used while 20M bw is selected */
   693		cch_by_bw[RTW_CHANNEL_WIDTH_20] = primary_channel;
   694	
   695		/* assign the center channel used while current bw is selected */
   696		cch_by_bw[bandwidth] = center_channel;
   697	
   698		switch (bandwidth) {
   699		case RTW_CHANNEL_WIDTH_20:
   700			primary_channel_idx = RTW_SC_DONT_CARE;
   701			break;
   702		case RTW_CHANNEL_WIDTH_40:
   703			if (primary_freq > center_freq)
   704				primary_channel_idx = RTW_SC_20_UPPER;
   705			else
   706				primary_channel_idx = RTW_SC_20_LOWER;
   707			break;
   708		case RTW_CHANNEL_WIDTH_80:
   709			if (primary_freq > center_freq) {
   710				if (primary_freq - center_freq == 10)
   711					primary_channel_idx = RTW_SC_20_UPPER;
   712				else
   713					primary_channel_idx = RTW_SC_20_UPMOST;
   714	
   715				/* assign the center channel used
   716				 * while 40M bw is selected
   717				 */
   718				cch_by_bw[RTW_CHANNEL_WIDTH_40] = center_channel + 4;
   719			} else {
   720				if (center_freq - primary_freq == 10)
   721					primary_channel_idx = RTW_SC_20_LOWER;
   722				else
   723					primary_channel_idx = RTW_SC_20_LOWEST;
   724	
   725				/* assign the center channel used
   726				 * while 40M bw is selected
   727				 */
   728				cch_by_bw[RTW_CHANNEL_WIDTH_40] = center_channel - 4;
   729			}
   730			break;
 > 731		default:
   732			break;
   733		}
   734	
   735		switch (center_channel) {
   736		case 1 ... 14:
   737			sar_band = RTW_SAR_BAND_0;
   738			break;
   739		case 36 ... 64:
   740			sar_band = RTW_SAR_BAND_1;
   741			break;
   742		case 100 ... 144:
   743			sar_band = RTW_SAR_BAND_3;
   744			break;
   745		case 149 ... 177:
   746			sar_band = RTW_SAR_BAND_4;
   747			break;
   748		default:
   749			WARN(1, "unknown ch(%u) to SAR band\n", center_channel);
   750			sar_band = RTW_SAR_BAND_0;
   751			break;
   752		}
   753	
   754		hal->current_primary_channel_index = primary_channel_idx;
   755		hal->current_band_width = bandwidth;
   756		hal->primary_channel = primary_channel;
   757		hal->current_channel = center_channel;
   758		hal->current_band_type = band;
   759		hal->sar_band = sar_band;
   760	}
   761	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-13  5:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20220809084107.38137-4-pkshih@realtek.com>
2022-08-13  5:54 ` [PATCH v2 3/7] wifi: rtw88: add the update channel flow to support setting by parameters 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