From: Christian Marangi Date: Sun, 14 May 2023 14:29:48 +0000 (+0200) Subject: gl-mifi-mcu: fix compilation warning for conflicting function X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=7118a45a9b091439348cd5341bcd632e1b2a90e8;p=openwrt-packages.git gl-mifi-mcu: fix compilation warning for conflicting function Module called the exit module function "exit", This conflicts with the stdlib header that use exit() to exit userspace program. Correctly assign a namespace to these functions. (init and exit) Fix compilation warning: warning: the compiler differs from the one used to build the kernel The kernel was built by: aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 12.2.0 r21757+608-895f38ca1e) 12.2.0 You are using: aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 12.2.0 r21757+1091-895f38ca1e) 12.2.0 CC [M] /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/gl-mifi-mcu-1/module.o /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/gl-mifi-mcu-1/module.c:196:20: error: conflicting types for built-in function 'exit'; expected 'void(int)' [-Werror=builtin-declaration-mismatch] 196 | static void __exit exit(void) | ^~~~ /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/gl-mifi-mcu-1/module.c:9:1: note: 'exit' is declared in header '' 8 | #include +++ |+#include 9 | cc1: all warnings being treated as errors Signed-off-by: Christian Marangi --- diff --git a/utils/gl-mifi-mcu/src/module.c b/utils/gl-mifi-mcu/src/module.c index 8f5a5146b..98fc7fab8 100755 --- a/utils/gl-mifi-mcu/src/module.c +++ b/utils/gl-mifi-mcu/src/module.c @@ -164,7 +164,7 @@ static enum hrtimer_restart handle_rx(struct hrtimer* timer) return result; } -static int __init init(void) +static int __init gl_mifi_mcu_init(void) { bool success = true; @@ -193,7 +193,7 @@ static int __init init(void) return success; } -static void __exit exit(void) +static void __exit gl_mifi_mcu_exit(void) { disable_irq(gpio_to_irq(gpio_rx)); hrtimer_cancel(&timer_tx); @@ -205,6 +205,6 @@ static void __exit exit(void) remove_proc_entry("gl_mifi_mcu", NULL); } -module_init(init); -module_exit(exit); +module_init(gl_mifi_mcu_init); +module_exit(gl_mifi_mcu_exit);