]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mt76: mt7615: Fix build with older compilers
authorPablo Greco <pgreco@centosproject.org>
Sun, 1 Dec 2019 18:17:10 +0000 (15:17 -0300)
committerFelix Fietkau <nbd@nbd.name>
Fri, 14 Feb 2020 09:06:00 +0000 (10:06 +0100)
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 c45085ce7cf8 ("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>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/mac.c

index 4d528aa725fda3a14fd7d4abe16447ded4dfa985..b03b5c6fd57164168ed45c43dbf4f43ea5061daa 100644 (file)
 #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)