diff mbox series

mt76: mt7915: fix warning: variable 'flags' set but not used

Message ID 20211223065843.94919-1-bo.jiao@mediatek.com (mailing list archive)
State Accepted
Delegated to: Felix Fietkau
Headers show
Series mt76: mt7915: fix warning: variable 'flags' set but not used | expand

Commit Message

Bo Jiao Dec. 23, 2021, 6:58 a.m. UTC
From: Bo Jiao <Bo.Jiao@mediatek.com>

fix warning: variable 'flags' set but not used

Fixes: 0aa6b534b5e1 ("mt76: mt7915: update rx rate reporting for mt7916")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Comments

Felix Fietkau Dec. 23, 2021, 10:12 a.m. UTC | #1
On 2021-12-23 07:58, Bo Jiao wrote:
> From: Bo Jiao <Bo.Jiao@mediatek.com>
> 
> fix warning: variable 'flags' set but not used
> 
> Fixes: 0aa6b534b5e1 ("mt76: mt7915: update rx rate reporting for mt7916")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
> ---
>   drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 11 +----------
>   1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> index ee4535a..f6d6321 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> @@ -469,7 +469,7 @@ mt7915_mac_fill_rx_rate(struct mt7915_dev *dev,
>   			__le32 *rxv)
>   {
>   	u32 v0, v2;
> -	u8 flags, stbc, gi, bw, dcm, mode, nss;
> +	u8 stbc, gi, bw, dcm, mode, nss;
>   	int i, idx;
>   	bool cck = false;
>   
> @@ -505,20 +505,12 @@ mt7915_mac_fill_rx_rate(struct mt7915_dev *dev,
>   		status->encoding = RX_ENC_HT;
>   		if (i > 31)
>   			return -EINVAL;
> -
> -		flags = RATE_INFO_FLAGS_MCS;
> -		if (gi)
> -			flags |= RATE_INFO_FLAGS_SHORT_GI;
>   		break;
>   	case MT_PHY_TYPE_VHT:
>   		status->nss = nss;
>   		status->encoding = RX_ENC_VHT;
>   		if (i > 9)
>   			return -EINVAL;
> -
> -		flags = RATE_INFO_FLAGS_VHT_MCS;
> -		if (gi)
> -			flags |= RATE_INFO_FLAGS_SHORT_GI;
>   		break;
>   	case MT_PHY_TYPE_HE_MU:
>   	case MT_PHY_TYPE_HE_SU:
The short GI value should still be reported. I'm folding this change 
into the commit:

--- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
@@ -503,12 +503,16 @@ mt7915_mac_fill_rx_rate(struct mt7915_dev *dev,
   	case MT_PHY_TYPE_HT_GF:
   	case MT_PHY_TYPE_HT:
   		status->encoding = RX_ENC_HT;
+		if (gi)
+			status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
   		if (i > 31)
   			return -EINVAL;
   		break;
   	case MT_PHY_TYPE_VHT:
   		status->nss = nss;
   		status->encoding = RX_ENC_VHT;
+		if (gi)
+			status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
   		if (i > 9)
   			return -EINVAL;
   		break;
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
index ee4535a..f6d6321 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
@@ -469,7 +469,7 @@  mt7915_mac_fill_rx_rate(struct mt7915_dev *dev,
 			__le32 *rxv)
 {
 	u32 v0, v2;
-	u8 flags, stbc, gi, bw, dcm, mode, nss;
+	u8 stbc, gi, bw, dcm, mode, nss;
 	int i, idx;
 	bool cck = false;
 
@@ -505,20 +505,12 @@  mt7915_mac_fill_rx_rate(struct mt7915_dev *dev,
 		status->encoding = RX_ENC_HT;
 		if (i > 31)
 			return -EINVAL;
-
-		flags = RATE_INFO_FLAGS_MCS;
-		if (gi)
-			flags |= RATE_INFO_FLAGS_SHORT_GI;
 		break;
 	case MT_PHY_TYPE_VHT:
 		status->nss = nss;
 		status->encoding = RX_ENC_VHT;
 		if (i > 9)
 			return -EINVAL;
-
-		flags = RATE_INFO_FLAGS_VHT_MCS;
-		if (gi)
-			flags |= RATE_INFO_FLAGS_SHORT_GI;
 		break;
 	case MT_PHY_TYPE_HE_MU:
 	case MT_PHY_TYPE_HE_SU:
@@ -532,7 +524,6 @@  mt7915_mac_fill_rx_rate(struct mt7915_dev *dev,
 			status->he_gi = gi;
 
 		status->he_dcm = dcm;
-		flags |= RATE_INFO_FLAGS_HE_MCS;
 		break;
 	default:
 		return -EINVAL;