[OpenWrt-Devel] [PATCH mt76] mt7603: fix build with CONFIG_KERNEL_DYNAMIC_DEBUG=y

Petr Štetiar ynezz at true.cz
Sat Aug 3 16:16:11 EDT 2019

When building with CONFIG_KERNEL_DYNAMIC_DEBUG=y enabled, the build
fails with following error:

 <command-line>:0:37: error: redeclaration of enumerator 'IEEE80211_HW_REPORTS_TX_ACK_STATUS'
 <command-line>:0:37: note: in definition of macro 'IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN'
 In file included from mt76-2019-07-22-75656a45/mt7603/../mt76.h:27:0,
                 from mt76-2019-07-22-75656a45/mt7603/mt7603.h:8,
                 from mt76-2019-07-22-75656a45/mt7603/pci.c:7:
 usr/include/mac80211/net/mac80211.h:2293:2: note: previous definition of 'IEEE80211_HW_REPORTS_TX_ACK_STATUS' was here

This is caused by failing check-cc-enum build check due to the following
compile error:

 ./include/linux/dynamic_debug.h:77:14: error: 'KBUILD_MODNAME' undeclared (first use in this function); did you mean 'KERN_NODENAME'?
    .modname = KBUILD_MODNAME,   \

So this patch adds missing KBUILD_MODNAME variable to
CHECK_CC_ENUM_FLAGS in order to make check-cc-enum build check compile

Fixes: c4e4982fa923 ("mt7603: set IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN")
Cc: Felix Fietkau <nbd at nbd.name>
Reported-by: Joan Moreau <jom at grosjo.net>
Signed-off-by: Petr Štetiar <ynezz at true.cz>
 mt7603/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mt7603/Makefile b/mt7603/Makefile
index 46e3df56d5ce..29f896a5c3a0 100644
--- a/mt7603/Makefile
+++ b/mt7603/Makefile
@@ -1,6 +1,7 @@
 check-cc-enum = $(call try-run, echo "int v = $(1);" | $(CC) -Werror $(CHECK_CC_ENUM_FLAGS) $(2) -c -x c - -o "$$TMP",y,n)
 # backwards compatibility hack

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list