kernel: ltq-adsl: add patch fixing compilation warning
authorChristian Marangi <ansuelsmth@gmail.com>
Wed, 10 May 2023 15:17:49 +0000 (17:17 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Fri, 12 May 2023 01:15:45 +0000 (03:15 +0200)
commit119558a187f153a195e4254c5879b755a55e3217
tree04535c59ded12fe5514425a38e43f7a364a69aed
parent3ccdc15c6ab14df898d9f36f0d7fa752ac1c15d6
kernel: ltq-adsl: add patch fixing compilation warning

Add patch fixing compilation warning due to not handled switch
fallthrough, stack limit and compilation warning in g997 module.
Fix compilation warning:
/__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_ase/ltq-dsl-ase/drv_dsl_cpe_api-3.24.4.4/src/pm/drv_dsl_cpe_pm_core.c: In function 'DSL_DRV_PM_CountersReset':
/__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_ase/ltq-dsl-ase/drv_dsl_cpe_api-3.24.4.4/src/pm/drv_dsl_cpe_pm_core.c:2277:7: error: this statement may fall through [-Werror=implicit-fallthrough=]
 2277 |    if (ResetType == DSL_PM_RESET_HISTORY)
      |       ^
/__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_ase/ltq-dsl-ase/drv_dsl_cpe_api-3.24.4.4/src/pm/drv_dsl_cpe_pm_core.c:2280:4: note: here
 2280 |    case DSL_PM_RESET_TOTAL:
      |    ^~~~
/__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_ase/ltq-dsl-ase/drv_dsl_cpe_api-3.24.4.4/src/pm/drv_dsl_cpe_pm_core.c:2284:7: error: this statement may fall through [-Werror=implicit-fallthrough=]
 2284 |    if (ResetType == DSL_PM_RESET_TOTAL)
      |       ^
/__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_ase/ltq-dsl-ase/drv_dsl_cpe_api-3.24.4.4/src/pm/drv_dsl_cpe_pm_core.c:2287:4: note: here
 2287 |    case DSL_PM_RESET_HISTORY_SHOWTIME:
      |    ^~~~
cc1: all warnings being treated as errors

/__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_ase/ltq-dsl-ase/drv_dsl_cpe_api-3.24.4.4/src/device/drv_dsl_cpe_device_danube.c: In function 'DSL_DRV_DEV_AutobootHandleTraining':
/__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_ase/ltq-dsl-ase/drv_dsl_cpe_api-3.24.4.4/src/device/drv_dsl_cpe_device_danube.c:3189:19: error: this statement may fall through [-Werror=implicit-fallthrough=]
 3189 |                if (nErrCode != DSL_SUCCESS)
      |                   ^
/__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_ase/ltq-dsl-ase/drv_dsl_cpe_api-3.24.4.4/src/device/drv_dsl_cpe_device_danube.c:3197:13: note: here
 3197 |             case DSL_LINESTATE_IDLE:
      |             ^~~~
cc1: all warnings being treated as errors

/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_ase/ltq-dsl-ase/drv_dsl_cpe_api-3.24.4.4/src/g997/drv_dsl_cpe_api_g997_danube.c: In function 'DSL_DRV_DEV_G997_PowerManagementStateForcedTrigger':
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_ase/ltq-dsl-ase/drv_dsl_cpe_api-3.24.4.4/src/g997/drv_dsl_cpe_api_g997_danube.c:2532:52: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
 2532 |                      else if (((nVal >> 4) & 0x15) == 0x9)
      |                                                    ^~
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_ase/ltq-dsl-ase/drv_dsl_cpe_api-3.24.4.4/src/g997/drv_dsl_cpe_api_g997_danube.c: In function 'DSL_DRV_DEV_G997_DeltHlogGet':
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_ase/ltq-dsl-ase/drv_dsl_cpe_api-3.24.4.4/src/g997/drv_dsl_cpe_api_g997_danube.c:2108:1: error: the frame size of 1056 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
 2108 | }
      | ^
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
package/kernel/lantiq/ltq-adsl/patches/201-fix-compilation-warning-fallthrough.patch [new file with mode: 0644]
package/kernel/lantiq/ltq-adsl/patches/202-g997_danube-dynamically-allocate-hlogdata.patch [new file with mode: 0644]
package/kernel/lantiq/ltq-adsl/patches/203-g997_danube-fix-compilation-warning.patch [new file with mode: 0644]