summaryrefslogtreecommitdiffstats
path: root/debian/patches/bugfix/all/mt76-use-the-correct-hweight8-function.patch
blob: ce3b63af32fbd277f1db25074b99e54db0a3cbf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From: Ben Hutchings <ben@decadent.org.uk>
Date: Tue, 12 Feb 2019 15:20:48 +0000
Subject: mt76: Use the correct hweight8() function
Forwarded: https://marc.info/?l=linux-wireless&m=154998579614180&w=2

mt76_init_stream_cap() and mt76_get_txpower() call __sw_hweight8()
directly, but that's only defined if CONFIG_GENERIC_HWEIGHT is
enabled.  The function that works on all architectures is hweight8().

Fixes: 551e1ef4d291 ("mt76: add mt76_init_stream_cap routine")
Fixes: 9313faacbb4e ("mt76: move mt76x02_get_txpower to mt76 core")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
[bwh: For 4.19, drop change in mt76_get_txpower()]
---
 drivers/net/wireless/mediatek/mt76/mac80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/drivers/net/wireless/mediatek/mt76/mac80211.c
===================================================================
--- linux.orig/drivers/net/wireless/mediatek/mt76/mac80211.c
+++ linux/drivers/net/wireless/mediatek/mt76/mac80211.c
@@ -124,7 +124,7 @@ static void mt76_init_stream_cap(struct
 				 bool vht)
 {
 	struct ieee80211_sta_ht_cap *ht_cap = &sband->ht_cap;
-	int i, nstream = __sw_hweight8(dev->antenna_mask);
+	int i, nstream = hweight8(dev->antenna_mask);
 	struct ieee80211_sta_vht_cap *vht_cap;
 	u16 mcs_map = 0;