lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202112210355.uzkDTs8K-lkp@intel.com>
Date:   Tue, 21 Dec 2021 03:45:34 +0800
From:   kernel test robot <lkp@...el.com>
To:     Bo Jiao <Bo.Jiao@...iatek.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Felix Fietkau <nbd@....name>,
        Sujuan Chen <sujuan.chen@...iatek.com>,
        Ryder Lee <ryder.lee@...iatek.com>
Subject: [nbd168-wireless:mt76 75/86]
 drivers/net/wireless/mediatek/mt76/mt7915/mac.c:472:13: warning: variable
 'legacy' set but not used

tree:   https://github.com/nbd168/wireless mt76
head:   632aeeec329ae1e7426806dfd825e7efdd4e73e8
commit: d2cf90e432b3f94878b2bbbee11f5ea0500020dd [75/86] mt76: mt7915: update rx rate reporting for mt7916
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20211221/202112210355.uzkDTs8K-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 11.2.0
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/nbd168/wireless/commit/d2cf90e432b3f94878b2bbbee11f5ea0500020dd
        git remote add nbd168-wireless https://github.com/nbd168/wireless
        git fetch --no-tags nbd168-wireless mt76
        git checkout d2cf90e432b3f94878b2bbbee11f5ea0500020dd
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=alpha SHELL=/bin/bash drivers/net/wireless/mediatek/mt76/mt7915/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   drivers/net/wireless/mediatek/mt76/mt7915/mac.c: In function 'mt7915_mac_fill_rx_rate':
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:472:13: warning: variable 'legacy' set but not used [-Wunused-but-set-variable]
     472 |         u16 legacy;
         |             ^~~~~~
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:471:17: warning: variable 'v1' set but not used [-Wunused-but-set-variable]
     471 |         u32 v0, v1, v2;
         |                 ^~


vim +/legacy +472 drivers/net/wireless/mediatek/mt76/mt7915/mac.c

   464	
   465	static int
   466	mt7915_mac_fill_rx_rate(struct mt7915_dev *dev,
   467				struct mt76_rx_status *status,
   468				struct ieee80211_supported_band *sband,
   469				__le32 *rxv)
   470	{
 > 471		u32 v0, v1, v2;
 > 472		u16 legacy;
   473		u8 flags, stbc, gi, bw, dcm, mode, nss;
   474		int i, idx;
   475		bool cck = false;
   476	
   477		v0 = le32_to_cpu(rxv[0]);
   478		v1 = le32_to_cpu(rxv[1]);
   479		v2 = le32_to_cpu(rxv[2]);
   480	
   481		idx = i = FIELD_GET(MT_PRXV_TX_RATE, v0);
   482		nss = FIELD_GET(MT_PRXV_NSTS, v0) + 1;
   483	
   484		if (!is_mt7915(&dev->mt76)) {
   485			stbc = FIELD_GET(MT_PRXV_HT_STBC, v0);
   486			gi = FIELD_GET(MT_PRXV_HT_SHORT_GI, v0);
   487			mode = FIELD_GET(MT_PRXV_TX_MODE, v0);
   488			dcm = FIELD_GET(MT_PRXV_DCM, v0);
   489			bw = FIELD_GET(MT_PRXV_FRAME_MODE, v0);
   490		} else {
   491			stbc = FIELD_GET(MT_CRXV_HT_STBC, v2);
   492			gi = FIELD_GET(MT_CRXV_HT_SHORT_GI, v2);
   493			mode = FIELD_GET(MT_CRXV_TX_MODE, v2);
   494			dcm = !!(idx & GENMASK(3, 0) & MT_PRXV_TX_DCM);
   495			bw = FIELD_GET(MT_CRXV_FRAME_MODE, v2);
   496		}
   497	
   498		switch (mode) {
   499		case MT_PHY_TYPE_CCK:
   500			cck = true;
   501			fallthrough;
   502		case MT_PHY_TYPE_OFDM:
   503			i = mt76_get_rate(&dev->mt76, sband, i, cck);
   504			legacy = sband->bitrates[i].bitrate;
   505			break;
   506		case MT_PHY_TYPE_HT_GF:
   507		case MT_PHY_TYPE_HT:
   508			status->encoding = RX_ENC_HT;
   509			if (i > 31)
   510				return -EINVAL;
   511	
   512			flags = RATE_INFO_FLAGS_MCS;
   513			if (gi)
   514				flags |= RATE_INFO_FLAGS_SHORT_GI;
   515			break;
   516		case MT_PHY_TYPE_VHT:
   517			status->nss = nss;
   518			status->encoding = RX_ENC_VHT;
   519			if (i > 9)
   520				return -EINVAL;
   521	
   522			flags = RATE_INFO_FLAGS_VHT_MCS;
   523			if (gi)
   524				flags |= RATE_INFO_FLAGS_SHORT_GI;
   525			break;
   526		case MT_PHY_TYPE_HE_MU:
   527		case MT_PHY_TYPE_HE_SU:
   528		case MT_PHY_TYPE_HE_EXT_SU:
   529		case MT_PHY_TYPE_HE_TB:
   530			status->nss = nss;
   531			status->encoding = RX_ENC_HE;
   532			i &= GENMASK(3, 0);
   533	
   534			if (gi <= NL80211_RATE_INFO_HE_GI_3_2)
   535				status->he_gi = gi;
   536	
   537			status->he_dcm = dcm;
   538			flags |= RATE_INFO_FLAGS_HE_MCS;
   539			break;
   540		default:
   541			return -EINVAL;
   542		}
   543		status->rate_idx = i;
   544	
   545		switch (bw) {
   546		case IEEE80211_STA_RX_BW_20:
   547			break;
   548		case IEEE80211_STA_RX_BW_40:
   549			if (mode & MT_PHY_TYPE_HE_EXT_SU &&
   550			    (idx & MT_PRXV_TX_ER_SU_106T)) {
   551				status->bw = RATE_INFO_BW_HE_RU;
   552				status->he_ru =
   553					NL80211_RATE_INFO_HE_RU_ALLOC_106;
   554			} else {
   555				status->bw = RATE_INFO_BW_40;
   556			}
   557			break;
   558		case IEEE80211_STA_RX_BW_80:
   559			status->bw = RATE_INFO_BW_80;
   560			break;
   561		case IEEE80211_STA_RX_BW_160:
   562			status->bw = RATE_INFO_BW_160;
   563			break;
   564		default:
   565			return -EINVAL;
   566		}
   567	
   568		status->enc_flags |= RX_ENC_FLAG_STBC_MASK * stbc;
   569		if (mode < MT_PHY_TYPE_HE_SU && gi)
   570			status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
   571	
   572		return 0;
   573	}
   574	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ