[PATCH -next] mt76: mt7915: Fix build error
From: YueHaibing
Date: Thu May 21 2020 - 23:48:06 EST
In file included from ./include/linux/firmware.h:6:0,
from drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:4:
In function â__mt7915_mcu_msg_sendâ,
inlined from âmt7915_mcu_send_messageâ at drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:370:6:
./include/linux/compiler.h:396:38: error: call to â__compiletime_assert_545â declared with attribute error: BUILD_BUG_ON failed: cmd == MCU_EXT_CMD_EFUSE_ACCESS && mcu_txd->set_query != MCU_Q_QUERY
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
./include/linux/compiler.h:377:4: note: in definition of macro â__compiletime_assertâ
prefix ## suffix(); \
^~~~~~
./include/linux/compiler.h:396:2: note: in expansion of macro â_compiletime_assertâ
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro âcompiletime_assertâ
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:50:2: note: in expansion of macro âBUILD_BUG_ON_MSGâ
BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
^~~~~~~~~~~~~~~~
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:280:2: note: in expansion of macro âBUILD_BUG_ONâ
BUILD_BUG_ON(cmd == MCU_EXT_CMD_EFUSE_ACCESS &&
^~~~~~~~~~~~
BUILD_BUG_ON is meaningless here, chang it to WARN_ON.
Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
---
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index f00ad2b66761..99eeea42478f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -277,8 +277,8 @@ static int __mt7915_mcu_msg_send(struct mt7915_dev *dev, struct sk_buff *skb,
}
mcu_txd->s2d_index = MCU_S2D_H2N;
- BUILD_BUG_ON(cmd == MCU_EXT_CMD_EFUSE_ACCESS &&
- mcu_txd->set_query != MCU_Q_QUERY);
+ WARN_ON(cmd == MCU_EXT_CMD_EFUSE_ACCESS &&
+ mcu_txd->set_query != MCU_Q_QUERY);
exit:
if (wait_seq)
--
2.17.1