Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line 557 in rtl8812au/core/rtw_cmd.c i get the following error: control reaches end of non-void function #250

Open
nick9982 opened this issue Jul 6, 2022 · 7 comments

Comments

@nick9982
Copy link

nick9982 commented Jul 6, 2022

When I run make to build the driver I get the following errors.

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.13.0-52-generic/build M=/home/nicholas/wifidriver2/rtl8812au modules
make[1]: Entering directory '/usr/src/linux-headers-5.13.0-52-generic'
CC [M] /home/nicholas/wifidriver2/rtl8812au/core/rtw_cmd.o
/home/nicholas/wifidriver2/rtl8812au/core/rtw_cmd.c: In function ‘rtw_cmd_thread’:
/home/nicholas/wifidriver2/rtl8812au/core/rtw_cmd.c:557:1: error: control reaches end of non-void function [-Werror=return-type]
557 | }
| ^
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:281: /home/nicholas/wifidriver2/rtl8812au/core/rtw_cmd.o] Error 1
make[1]: *** [Makefile:1879: /home/nicholas/wifidriver2/rtl8812au] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.13.0-52-generic'
make: *** [Makefile:1086: modules] Error 2

@magicly
Copy link

magicly commented Jul 7, 2022

我也遇到了同样的问题, 坐等大神回复

@magicly
Copy link

magicly commented Jul 7, 2022

搜了一下, 在Makefile中添加一行代码即可。

EXTRA_CFLAGS += -Wno-return-type

编译过了, 但是最后报错

  CC [M]  /home/ly/code/rtl8812au/core/rtw_mp_ioctl.o
  LD [M]  /home/ly/code/rtl8812au/8812au.o
  MODPOST /home/ly/code/rtl8812au/Module.symvers
ERROR: modpost: "kthread_complete_and_exit" [/home/ly/code/rtl8812au/8812au.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:150: /home/ly/code/rtl8812au/Module.symvers] Error 1
make[2]: *** Deleting file '/home/ly/code/rtl8812au/Module.symvers'
make[1]: *** [Makefile:1794: modules] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.13.0-52-generic'
make: *** [Makefile:1087: modules] Error 2

@magicly
Copy link

magicly commented Jul 7, 2022

原来是kernel 5.17改名字了, 我的kernel是5.13的。 grep一下kthread_complete_and_exit, 发现是在include/osdep_service_linux.h 149行, 改为如下即可:

#define thread_exit() complete_and_exit(NULL, 0)

参考 Kernel 5.17 renames complete_and_exit to kthread_complete_and_exit lwfinger/rtl8723ds#15
https://lore.kernel.org/lkml/20211208202532.16409-8-ebiederm@xmission.com/

@magicly
Copy link

magicly commented Jul 7, 2022

测试发现, 其实第一个错误可以不管, 只需要改thread_exit定义即可:

diff --git a/include/osdep_service_linux.h b/include/osdep_service_linux.h
index 32a55b9..44fa5d5 100644
--- a/include/osdep_service_linux.h
+++ b/include/osdep_service_linux.h
@@ -146,7 +146,7 @@
        typedef int             thread_return;
        typedef void*   thread_context;

-       #define thread_exit() kthread_complete_and_exit(NULL, 0)
+       #define thread_exit() complete_and_exit(NULL, 0)^M

        typedef void timer_hdl_return;
        typedef void* timer_hdl_context;

@nick9982
Copy link
Author

nick9982 commented Jul 8, 2022

@magicly What you told me works. Thanks a lot magicly!

@magicly
Copy link

magicly commented Jul 8, 2022

My pleasure~

@topherbuckley
Copy link

This is address in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants