linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mt76: Use the correct hweight8() function
@ 2019-02-12 15:36 Ben Hutchings
  2019-02-18 19:11 ` Felix Fietkau
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Hutchings @ 2019-02-12 15:36 UTC (permalink / raw)
  To: Felix Fietkau, Lorenzo Bianconi; +Cc: linux-wireless

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

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>
---
 drivers/net/wireless/mediatek/mt76/mac80211.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c
index 484d3ac3a206..7c3a24cc9c77 100644
--- a/drivers/net/wireless/mediatek/mt76/mac80211.c
+++ b/drivers/net/wireless/mediatek/mt76/mac80211.c
@@ -124,7 +124,7 @@ static void mt76_init_stream_cap(struct mt76_dev *dev,
 				 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;
 
@@ -714,7 +714,7 @@ int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		     int *dbm)
 {
 	struct mt76_dev *dev = hw->priv;
-	int n_chains = __sw_hweight8(dev->antenna_mask);
+	int n_chains = hweight8(dev->antenna_mask);
 
 	*dbm = dev->txpower_cur / 2;
 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mt76: Use the correct hweight8() function
  2019-02-12 15:36 [PATCH] mt76: Use the correct hweight8() function Ben Hutchings
@ 2019-02-18 19:11 ` Felix Fietkau
  0 siblings, 0 replies; 2+ messages in thread
From: Felix Fietkau @ 2019-02-18 19:11 UTC (permalink / raw)
  To: Ben Hutchings, Lorenzo Bianconi; +Cc: linux-wireless

On 2019-02-12 16:36, Ben Hutchings wrote:
> 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>
Applied, thanks.

- Felix

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-18 19:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-12 15:36 [PATCH] mt76: Use the correct hweight8() function Ben Hutchings
2019-02-18 19:11 ` Felix Fietkau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).