2019-12-01 18:27:46

by Pablo Greco

[permalink] [raw]
Subject: [PATCH v1] mt76: mt7615: Fix build with older compilers

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 <[email protected]>
Signed-off-by: Pablo Greco <[email protected]>
---
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


2019-12-02 09:21:19

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH v1] mt76: mt7615: Fix build with older compilers

Hello!

On 01.12.2019 21:17, Pablo Greco wrote:

> Some compilers (tested with 4.8.5 from CentOS 7) fail properly process

Fail to?

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

Should be:

Fixes: bf92e7685100 ("mt76: mt7615: add support for per-chain signal strength
reporting")

Do not ever break up the Fixes: line and don't insert empty lines between
it and other tags.

> Reported in https://lkml.org/lkml/2019/9/21/146
>
> Reported-by: kbuild test robot <[email protected]>
> Signed-off-by: Pablo Greco <[email protected]>
[...]

MBR, Sergei