kernel: ltq-vdsl-vr11-mei: fix compilation warning
authorChristian Marangi <ansuelsmth@gmail.com>
Wed, 10 May 2023 16:36:20 +0000 (18:36 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Fri, 12 May 2023 01:15:45 +0000 (03:15 +0200)
commit717d482cd0b4f58430e4466da31ae54e351e7caa
treef0a905aa1273c461b5840ef38e06575d8ade9f6b
parentdebb8be363aa0c31941fc21150b9ec65a91d66d3
kernel: ltq-vdsl-vr11-mei: fix compilation warning

Fix compilation warning in variable length array msg and ret value not
handled.
Fix compilation warning:
/__w/openwrt/openwrt/openwrt/build_dir/target-arm-openwrt-linux-muslgnueabi_musl/linux-ipq40xx_chromium/dsl_cpe_mei-ugw_8.5.2.10/src/drv_mei_cpe_api_intern.c: In function 'MEI_Internal_DumpMessage':
/__w/openwrt/openwrt/openwrt/build_dir/target-arm-openwrt-linux-muslgnueabi_musl/linux-ipq40xx_chromium/dsl_cpe_mei-ugw_8.5.2.10/src/drv_mei_cpe_api_intern.c:441:4: error: ISO C90 forbids variable length array 'msg' [-Werror=vla]
  441 |    char msg[nMsgSize];
      |    ^~~~
/__w/openwrt/openwrt/openwrt/build_dir/target-arm-openwrt-linux-muslgnueabi_musl/linux-ipq40xx_chromium/dsl_cpe_mei-ugw_8.5.2.10/src/drv_mei_cpe_api_intern.c:442:4: error: ISO C90 forbids array 'buf' whose size cannot be evaluated [-Werror=vla]
  442 |    char buf[nBufSize];
      |    ^~~~
cc1: all warnings being treated as errors

/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-arm-openwrt-linux-muslgnueabi_musl/linux-ipq40xx_generic/dsl_cpe_mei-ugw_8.5.2.10/src/drv_mei_cpe_linux.c: In function 'MEI_Ioctl':
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-arm-openwrt-linux-muslgnueabi_musl/linux-ipq40xx_generic/dsl_cpe_mei-ugw_8.5.2.10/src/drv_mei_cpe_linux.c:1270:4: error: ignoring return value of 'copy_to_user' declared with attribute 'warn_unused_result' [-Werror=unused-result]
 1270 |    copy_to_user( ((IOCTL_MEI_arg_t *)nArgument), &local_args, retSize);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-arm-openwrt-linux-muslgnueabi_musl/linux-ipq40xx_generic/dsl_cpe_mei-ugw_8.5.2.10/src/drv_mei_cpe_linux.c: In function 'MEI_IoctlMeiDbgAccessWr_Wrap':
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-arm-openwrt-linux-muslgnueabi_musl/linux-ipq40xx_generic/dsl_cpe_mei-ugw_8.5.2.10/src/drv_mei_cpe_linux.c:3574:4: error: ignoring return value of 'copy_to_user' declared with attribute 'warn_unused_result' [-Werror=unused-result]
 3574 |    copy_to_user( (void *)&pUserArgument->count,
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 3575 |                  (void *)&pLocalArgument->count,
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 3576 |                  sizeof(pUserArgument->count) ) ;
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-arm-openwrt-linux-muslgnueabi_musl/linux-ipq40xx_generic/dsl_cpe_mei-ugw_8.5.2.10/src/drv_mei_cpe_linux.c: In function 'MEI_IoctlMeiDbgAccessRd_Wrap':
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-arm-openwrt-linux-muslgnueabi_musl/linux-ipq40xx_generic/dsl_cpe_mei-ugw_8.5.2.10/src/drv_mei_cpe_linux.c:3603:7: error: ignoring return value of 'copy_to_user' declared with attribute 'warn_unused_result' [-Werror=unused-result]
 3603 |       copy_to_user( pUserBuf,
      |       ^~~~~~~~~~~~~~~~~~~~~~~
 3604 |                     pLocalArgument->pData_32,
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~
 3605 |                     pLocalArgument->count * sizeof(IFX_uint32_t) ) ;
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-arm-openwrt-linux-muslgnueabi_musl/linux-ipq40xx_generic/dsl_cpe_mei-ugw_8.5.2.10/src/drv_mei_cpe_linux.c:3610:4: error: ignoring return value of 'copy_to_user' declared with attribute 'warn_unused_result' [-Werror=unused-result]
 3610 |    copy_to_user( (void *)&pUserArgument->count,
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 3611 |                  (void *)&pLocalArgument->count,
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 3612 |                  sizeof(pUserArgument->count) ) ;
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/121-cpe-api-intern-dynamically-allocate-dump-msg.patch [new file with mode: 0644]
package/kernel/lantiq/ltq-vdsl-vr11-mei/patches/122-cp_linux-fix-compilation-warning.patch [new file with mode: 0644]