kernel: ltq-vdsl-vr9-mei: fix compilation warning
authorChristian Marangi <ansuelsmth@gmail.com>
Sun, 14 May 2023 00:34:58 +0000 (02:34 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Sun, 14 May 2023 00:42:53 +0000 (02:42 +0200)
Fix simple compilation warning due to cast and wrong include.
Fix compilation warning:
In file included from ./include/linux/compat.h:18,
                 from ./include/linux/filter.h:10,
                 from ./include/net/sock.h:59,
                 from /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xrx200/drv_mei_cpe-1.5.17.6/src/drv_mei_cpe_linux.c:70:
./include/uapi/linux/aio_abi.h:77:45: error: "__LITTLE_ENDIAN" is not defined, evaluates to 0 [-Werror=undef]
   77 | #if defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN)
      |                                             ^~~~~~~~~~~~~~~
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xrx200/drv_mei_cpe-1.5.17.6/src/drv_mei_cpe_linux.c: In function 'MEI_MeminfoProcPerDevGet':
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xrx200/drv_mei_cpe-1.5.17.6/src/drv_mei_cpe_linux.c:1715:56: error: format '%X' expects argument of type 'unsigned int', but argument 4 has type 'IFX_uint8_t *' {aka 'unsigned char *'} [-Werror=format=]
 1715 |                seq_printf(s, "chunk[%02d]: addr = 0x%08X (0x%08X), "
      |                                                     ~~~^
      |                                                        |
      |                                                        unsigned int
      |                                                     %08hhn
......
 1721 |                      chunkIdx, pChunk[chunkIdx].pImageChunk_aligned,
      |                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                |
      |                                                IFX_uint8_t * {aka unsigned char *}
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xrx200/drv_mei_cpe-1.5.17.6/src/drv_mei_cpe_linux.c:1715:64: error: format '%X' expects argument of type 'unsigned int', but argument 5 has type 'IFX_uint8_t *' {aka 'unsigned char *'} [-Werror=format=]
 1715 |                seq_printf(s, "chunk[%02d]: addr = 0x%08X (0x%08X), "
      |                                                             ~~~^
      |                                                                |
      |                                                                unsigned int
      |                                                             %08hhn
......
 1722 |                      pChunk[chunkIdx].pImageChunk_allocated,
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                      |
      |                                      IFX_uint8_t * {aka unsigned char *}
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/300-fix-simple-compilation-warning.patch [new file with mode: 0644]

diff --git a/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/300-fix-simple-compilation-warning.patch b/package/kernel/lantiq/ltq-vdsl-vr9-mei/patches/300-fix-simple-compilation-warning.patch
new file mode 100644 (file)
index 0000000..e9f1931
--- /dev/null
@@ -0,0 +1,37 @@
+--- a/src/drv_mei_cpe_linux.c
++++ b/src/drv_mei_cpe_linux.c
+@@ -67,7 +67,7 @@
+ #if (MEI_SUPPORT_DEBUG_LOGGER == 1)
+ #include <linux/skbuff.h>
+ #include <linux/netlink.h>
+-#include <net/sock.h>
++#include <net/netlink.h>
+ #endif
+ /* add MEI CPE debug/printout part */
+@@ -1718,8 +1718,8 @@ static void MEI_MeminfoProcPerDevGet(struct seq_file *s)
+                      ", CRC = 0x%08X"
+ #endif
+                      MEI_DRV_CRLF,
+-                     chunkIdx, pChunk[chunkIdx].pImageChunk_aligned,
+-                     pChunk[chunkIdx].pImageChunk_allocated,
++                     chunkIdx, (unsigned int)pChunk[chunkIdx].pImageChunk_aligned,
++                     (unsigned int)pChunk[chunkIdx].pImageChunk_allocated,
+                      pChunk[chunkIdx].imageChunkSize_byte,
+                      pChunk[chunkIdx].eImageChunkType
+ #if (MEI_SUPPORT_OPTIMIZED_FW_DL == 1)
+--- a/src/drv_mei_cpe_download_vrx.c
++++ b/src/drv_mei_cpe_download_vrx.c
+@@ -3139,9 +3139,9 @@ IFX_int32_t MEI_DEV_IoctlFirmwareDownload(
+ {
+    IFX_int32_t ret = 0;
+    MEI_DEV_T *pMeiDev = pMeiDynCntrl->pMeiDev;
+-#if (MEI_EXPORT_INTERNAL_API == 1) && (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1)
+-   MEI_TC_Reset_t tc_reset = {0};
+-#endif
++// #if (MEI_EXPORT_INTERNAL_API == 1) && (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1)
++//    MEI_TC_Reset_t tc_reset = {0};
++// #endif
+ #if (MEI_SUPPORT_OPTIMIZED_FW_DL == 1)
+    IFX_boolean_t bChunksReuse = IFX_FALSE;
+ #endif