Re: [PATCH -next] mt76: mt7915: Fix build error

From: Kalle Valo
Date: Mon May 25 2020 - 06:37:40 EST


Yuehaibing <yuehaibing@xxxxxxxxxx> writes:

> On 2020/5/22 18:11, Kalle Valo wrote:
>> YueHaibing <yuehaibing@xxxxxxxxxx> writes:
>>
>>> 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>
>>
>> I'm curious why I don't see this build error? I was about to send a pull
>> request to Dave, should I hold off the pull request due to this problem?
>
> The config is attached
>
> gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)

Thanks, I was able to reproduce the error with gcc-10 using your config
but didn't have time to investigate what was different in my config and
why I didn't see it.

--
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches