gl-mifi-mcu: fix compilation warning for conflicting function
authorChristian Marangi <ansuelsmth@gmail.com>
Sun, 14 May 2023 14:29:48 +0000 (16:29 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Sun, 14 May 2023 14:51:48 +0000 (16:51 +0200)
commit7118a45a9b091439348cd5341bcd632e1b2a90e8
treec0eea2f8b91430bea40ed2e88eb06108dc7c36cf
parente15d9f75dac2888b9d863c6f2d1c19637631c1fb
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 '<stdlib.h>'
    8 | #include <linux/version.h>
  +++ |+#include <stdlib.h>
    9 |
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
utils/gl-mifi-mcu/src/module.c