linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] mt76: mt7615: Fix build with older compilers
@ 2019-12-01 18:17 Pablo Greco
  2019-12-02  9:18 ` Sergei Shtylyov
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Pablo Greco @ 2019-12-01 18:17 UTC (permalink / raw)
  Cc: Pablo Greco, Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Roy Luo,
	Kalle Valo, David S. Miller, Matthias Brugger, linux-wireless,
	netdev, linux-arm-kernel, linux-mediatek, linux-kernel

Some compilers (tested with 4.8.5 from CentOS 7) fail properly process
FIELD_GET inside an inline function, which ends up in a BUILD_BUG_ON.
Convert inline function to a macro.

Fixes commit bf92e7685100 ("mt76: mt7615: add support for per-chain
signal strength reporting")
Reported in https://lkml.org/lkml/2019/9/21/146

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Pablo Greco <pgreco@centosproject.org>
---
 drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
index c77adc5d2552..77e395ca2c6a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
@@ -13,10 +13,7 @@
 #include "../dma.h"
 #include "mac.h"
 
-static inline s8 to_rssi(u32 field, u32 rxv)
-{
-	return (FIELD_GET(field, rxv) - 220) / 2;
-}
+#define to_rssi(field, rxv)		((FIELD_GET(field, rxv) - 220) / 2)
 
 static struct mt76_wcid *mt7615_rx_get_wcid(struct mt7615_dev *dev,
 					    u8 idx, bool unicast)
-- 
2.18.1


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

end of thread, other threads:[~2019-12-02 10:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-01 18:17 [PATCH v1] mt76: mt7615: Fix build with older compilers Pablo Greco
2019-12-02  9:18 ` Sergei Shtylyov
2019-12-02 10:30   ` Pablo Sebastián Greco
2019-12-02  9:25 ` Kalle Valo
     [not found] ` <0101016ec5ed7d91-eac61501-1e4a-42f1-881d-cc2c02eb8372-000000@us-west-2.amazonses.com>
2019-12-02 10:42   ` Pablo Sebastián Greco

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).