From 1d80b19d870091357bf3e54ceb232f37593e380b Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Tue, 12 Feb 2019 15:39:34 +0000 Subject: [PATCH] mt76: Use the correct hweight8() function (fixes FTBFS on ia64) --- debian/changelog | 1 + ...76-use-the-correct-hweight8-function.patch | 30 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 32 insertions(+) create mode 100644 debian/patches/bugfix/all/mt76-use-the-correct-hweight8-function.patch diff --git a/debian/changelog b/debian/changelog index 27bed7d19..204dcba0f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ linux (4.19.20-2) UNRELEASED; urgency=medium * [sparc64] udeb: Add i2c-modules and nic-shared-modules to avoid duplication + * mt76: Use the correct hweight8() function (fixes FTBFS on ia64) -- Ben Hutchings Tue, 12 Feb 2019 12:49:10 +0000 diff --git a/debian/patches/bugfix/all/mt76-use-the-correct-hweight8-function.patch b/debian/patches/bugfix/all/mt76-use-the-correct-hweight8-function.patch new file mode 100644 index 000000000..737d49bc4 --- /dev/null +++ b/debian/patches/bugfix/all/mt76-use-the-correct-hweight8-function.patch @@ -0,0 +1,30 @@ +From: Ben Hutchings +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 +[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(-) + +diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c +index 484d3ac3a206..d4eeae226f19 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; + diff --git a/debian/patches/series b/debian/patches/series index 65da4c754..eb64913dc 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -100,6 +100,7 @@ bugfix/all/partially-revert-usb-kconfig-using-select-for-usb_co.patch bugfix/all/kbuild-include-addtree-remove-quotes-before-matching-path.patch debian/revert-objtool-fix-config_stack_validation-y-warning.patch bugfix/all/percpu-convert-spin_lock_irq-to-spin_lock_irqsave.patch +bugfix/all/mt76-use-the-correct-hweight8-function.patch # Miscellaneous features