All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Bo Jiao <Bo.Jiao@mediatek.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org, Felix Fietkau <nbd@nbd.name>,
	Sujuan Chen <sujuan.chen@mediatek.com>,
	Ryder Lee <ryder.lee@mediatek.com>
Subject: [nbd168-wireless:mt76 10/28] drivers/net/wireless/mediatek/mt76/mt7915/mac.c:472:5: warning: variable 'flags' set but not used
Date: Thu, 23 Dec 2021 08:46:53 +0800	[thread overview]
Message-ID: <202112230801.vyMZPnaw-lkp@intel.com> (raw)

tree:   https://github.com/nbd168/wireless mt76
head:   05f0500c7b0147353e97de7369d504c5fbd3951e
commit: 0aa6b534b5e1cfe82e676d1d8f90bcea584565d3 [10/28] mt76: mt7915: update rx rate reporting for mt7916
config: mips-randconfig-r033-20211222 (https://download.01.org/0day-ci/archive/20211223/202112230801.vyMZPnaw-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project de4e0195ae1c39f1c3b07834b8e32c113f4f20eb)
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
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://github.com/nbd168/wireless/commit/0aa6b534b5e1cfe82e676d1d8f90bcea584565d3
        git remote add nbd168-wireless https://github.com/nbd168/wireless
        git fetch --no-tags nbd168-wireless mt76
        git checkout 0aa6b534b5e1cfe82e676d1d8f90bcea584565d3
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips 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@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:472:5: warning: variable 'flags' set but not used [-Wunused-but-set-variable]
           u8 flags, stbc, gi, bw, dcm, mode, nss;
              ^
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:535:3: warning: variable 'flags' is uninitialized when used here [-Wuninitialized]
                   flags |= RATE_INFO_FLAGS_HE_MCS;
                   ^~~~~
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:472:10: note: initialize the variable 'flags' to silence this warning
           u8 flags, stbc, gi, bw, dcm, mode, nss;
                   ^
                    = '\0'
   2 warnings generated.


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

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

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [nbd168-wireless:mt76 10/28] drivers/net/wireless/mediatek/mt76/mt7915/mac.c:472:5: warning: variable 'flags' set but not used
Date: Thu, 23 Dec 2021 08:46:53 +0800	[thread overview]
Message-ID: <202112230801.vyMZPnaw-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 5533 bytes --]

tree:   https://github.com/nbd168/wireless mt76
head:   05f0500c7b0147353e97de7369d504c5fbd3951e
commit: 0aa6b534b5e1cfe82e676d1d8f90bcea584565d3 [10/28] mt76: mt7915: update rx rate reporting for mt7916
config: mips-randconfig-r033-20211222 (https://download.01.org/0day-ci/archive/20211223/202112230801.vyMZPnaw-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project de4e0195ae1c39f1c3b07834b8e32c113f4f20eb)
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
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://github.com/nbd168/wireless/commit/0aa6b534b5e1cfe82e676d1d8f90bcea584565d3
        git remote add nbd168-wireless https://github.com/nbd168/wireless
        git fetch --no-tags nbd168-wireless mt76
        git checkout 0aa6b534b5e1cfe82e676d1d8f90bcea584565d3
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips 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@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:472:5: warning: variable 'flags' set but not used [-Wunused-but-set-variable]
           u8 flags, stbc, gi, bw, dcm, mode, nss;
              ^
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:535:3: warning: variable 'flags' is uninitialized when used here [-Wuninitialized]
                   flags |= RATE_INFO_FLAGS_HE_MCS;
                   ^~~~~
   drivers/net/wireless/mediatek/mt76/mt7915/mac.c:472:10: note: initialize the variable 'flags' to silence this warning
           u8 flags, stbc, gi, bw, dcm, mode, nss;
                   ^
                    = '\0'
   2 warnings generated.


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

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

             reply	other threads:[~2021-12-23  0:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-23  0:46 kernel test robot [this message]
2021-12-23  0:46 ` [nbd168-wireless:mt76 10/28] drivers/net/wireless/mediatek/mt76/mt7915/mac.c:472:5: warning: variable 'flags' set but not used kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202112230801.vyMZPnaw-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Bo.Jiao@mediatek.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nbd@nbd.name \
    --cc=ryder.lee@mediatek.com \
    --cc=sujuan.chen@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.