lwfinger / rtl8852au

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build error : fallthrough

biopsin opened this issue · comments

Hi, regards to changes in 803fc78

ioctl_cfg80211.c  CC [M]  /var/lib/dkms/8852au/20230905/build/os_dep/linux/rtw_android.o
In file included from /var/lib/dkms/8852au/20230905/build/include/drv_types.h:23,
                 from /var/lib/dkms/8852au/20230905/build/os_dep/linux/ioctl_cfg80211.c:17:
/var/lib/dkms/8852au/20230905/build/os_dep/linux/ioctl_cfg80211.c: In function 'rtw_get_chbwoff_from_cfg80211_chan_def':
/var/lib/dkms/8852au/20230905/build/include/drv_conf.h:54:22: error: expected expression before 'do'
   54 | #define fallthrough (do {} while(0))
      |                      ^~
/var/lib/dkms/8852au/20230905/build/os_dep/linux/ioctl_cfg80211.c:6270:17: note: in expansion of macro 'fallthrough'
 6270 |                 fallthrough;
      |                 ^~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:303: /var/lib/dkms/8852au/20230905/build/os_dep/linux/ioctl_cfg80211.o] Error 1
make[2]: *** Waiting for unfinished jobs....

had the same on kernel 4.9, asked ChatGPT and this is the fix, worked for me:

--- a/include/drv_conf.h
+++ b/include/drv_conf.h
@@ -51,7 +51,7 @@
 #endif

 #if !defined(fallthrough)
-#define fallthrough (do {} while(0))
+#define fallthrough __attribute__((fallthrough))
 #endif

 #ifdef CONFIG_RTW_ANDROID

@razvanphp mind creating a PR so a human can review it?
not that I dont trust you but I have trust issues with chatgpt and alike that randomly steals code from projects and tries to guess a solution.