mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-20 11:39:02 +00:00
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>
This commit is contained in:
parent
3ccdc15c6a
commit
119558a187
@ -0,0 +1,36 @@
|
||||
--- a/src/pm/drv_dsl_cpe_pm_core.c
|
||||
+++ b/src/pm/drv_dsl_cpe_pm_core.c
|
||||
@@ -2274,16 +2274,18 @@ DSL_Error_t DSL_DRV_PM_CountersReset(
|
||||
}
|
||||
#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY*/
|
||||
|
||||
- if (ResetType == DSL_PM_RESET_HISTORY)
|
||||
- break;
|
||||
+ if (ResetType == DSL_PM_RESET_HISTORY)
|
||||
+ break;
|
||||
|
||||
+ fallthrough;
|
||||
case DSL_PM_RESET_TOTAL:
|
||||
#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS
|
||||
memset(EpData.pRecTotal, 0x0, EpData.nEpRecElementSize);
|
||||
#endif /* #ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS*/
|
||||
- if (ResetType == DSL_PM_RESET_TOTAL)
|
||||
- break;
|
||||
+ if (ResetType == DSL_PM_RESET_TOTAL)
|
||||
+ break;
|
||||
|
||||
+ fallthrough;
|
||||
case DSL_PM_RESET_HISTORY_SHOWTIME:
|
||||
#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS
|
||||
nErrCode = DSL_DRV_PM_HistoryDelete(pContext, EpData.pHistShowtime );
|
||||
--- a/src/device/drv_dsl_cpe_device_danube.c
|
||||
+++ b/src/device/drv_dsl_cpe_device_danube.c
|
||||
@@ -3193,7 +3193,7 @@ DSL_Error_t DSL_DRV_DEV_AutobootHandleTraining(
|
||||
DSL_DEV_NUM(pContext)));
|
||||
}
|
||||
#endif /* INCLUDE_DSL_DELT*/
|
||||
- /* Pass through */
|
||||
+ fallthrough ;
|
||||
case DSL_LINESTATE_IDLE:
|
||||
#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS)
|
||||
if ( (pContext->bGotFullInit == DSL_TRUE) &&
|
@ -0,0 +1,65 @@
|
||||
--- a/src/g997/drv_dsl_cpe_api_g997_danube.c
|
||||
+++ b/src/g997/drv_dsl_cpe_api_g997_danube.c
|
||||
@@ -1984,41 +1984,53 @@ DSL_Error_t DSL_DRV_DEV_G997_DeltHlogGet(
|
||||
{
|
||||
if (nDirection == DSL_DOWNSTREAM)
|
||||
{
|
||||
- DSL_G997_DeltHlogData_t HlogData;
|
||||
+ DSL_G997_DeltHlogData_t *HlogData;
|
||||
|
||||
- memset(&HlogData, 0x0, sizeof(DSL_G997_DeltHlogData_t));
|
||||
+ HlogData = kzalloc(sizeof(*HlogData), GFP_KERNEL);
|
||||
+ if (!HlogData)
|
||||
+ {
|
||||
+ DSL_DEBUG(DSL_DBG_ERR,
|
||||
+ (pContext, "DSL[%02d]: ERROR - Alloc HlogData failed!"DSL_DRV_CRLF,
|
||||
+ DSL_DEV_NUM(pContext)));
|
||||
+ return DSL_ERR_MEMORY;
|
||||
+ }
|
||||
+
|
||||
+ memset(HlogData, 0x0, sizeof(DSL_G997_DeltHlogData_t));
|
||||
|
||||
/* Get SHOWTIME Hlog values*/
|
||||
nErrCode = DSL_DRV_DANUBE_G997_DeltHlogGet(
|
||||
- pContext, nDirection, &HlogData);
|
||||
+ pContext, nDirection, HlogData);
|
||||
if (nErrCode != DSL_SUCCESS)
|
||||
{
|
||||
DSL_DEBUG(DSL_DBG_ERR,
|
||||
(pContext, "DSL[%02d]: ERROR - Showtime Hlog get failed!"DSL_DRV_CRLF,
|
||||
DSL_DEV_NUM(pContext)));
|
||||
+ kfree(HlogData);
|
||||
return nErrCode;
|
||||
}
|
||||
|
||||
/* if actual group size != 1, values should be spread */
|
||||
- if (HlogData.nGroupSize != 1)
|
||||
+ if (HlogData->nGroupSize != 1)
|
||||
{
|
||||
nErrCode = DSL_DRV_DANUBE_G997_DeltValuesSpread(
|
||||
- 0x1, HlogData.nGroupSize, HlogData.deltHlog.nNumData,
|
||||
- HlogData.deltHlog.nNSCData, pData->deltHlog.nNSCData);
|
||||
+ 0x1, HlogData->nGroupSize, HlogData->deltHlog.nNumData,
|
||||
+ HlogData->deltHlog.nNSCData, pData->deltHlog.nNSCData);
|
||||
|
||||
if (nErrCode == DSL_SUCCESS)
|
||||
{
|
||||
pData->deltHlog.nNumData =
|
||||
- (DSL_uint16_t)(HlogData.deltHlog.nNumData * HlogData.nGroupSize);
|
||||
+ (DSL_uint16_t)(HlogData->deltHlog.nNumData * HlogData->nGroupSize);
|
||||
pData->nGroupSize = 1;
|
||||
- pData->nMeasurementTime = HlogData.nMeasurementTime;
|
||||
+ pData->nMeasurementTime = HlogData->nMeasurementTime;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No spread needed, copy data*/
|
||||
- memcpy(pData, &HlogData, sizeof(DSL_G997_DeltHlogData_t));
|
||||
+ memcpy(pData, HlogData, sizeof(DSL_G997_DeltHlogData_t));
|
||||
}
|
||||
+
|
||||
+ kfree(HlogData);
|
||||
}
|
||||
else
|
||||
{
|
@ -0,0 +1,26 @@
|
||||
--- a/src/g997/drv_dsl_cpe_api_g997_danube.c
|
||||
+++ b/src/g997/drv_dsl_cpe_api_g997_danube.c
|
||||
@@ -2512,6 +2524,7 @@ DSL_Error_t DSL_DRV_DEV_G997_PowerManagementStateForcedTrigger(
|
||||
else
|
||||
{
|
||||
/* read L3 request failure reason */
|
||||
+ DSL_uint8_t nErrCodeL3;
|
||||
nErrCode = DSL_DRV_DANUBE_CmvRead(pContext, DSL_CMV_GROUP_STAT,
|
||||
DSL_CMV_ADDRESS_STAT_L3_FAILURE_REASON, 0, 1, &nVal);
|
||||
DSL_DEBUG(DSL_DBG_MSG,
|
||||
@@ -2525,11 +2538,13 @@ DSL_Error_t DSL_DRV_DEV_G997_PowerManagementStateForcedTrigger(
|
||||
nErrCode = DSL_ERR_MSG_EXCHANGE;
|
||||
break;
|
||||
}
|
||||
- if (((nVal >> 4) & 0x15) == 0x5)
|
||||
+
|
||||
+ nErrCodeL3 = (nVal >> 4) & 0x15;
|
||||
+ if (nErrCodeL3 == 0x5)
|
||||
{
|
||||
nErrCode = DSL_ERR_L3_NOT_IN_L0;
|
||||
}
|
||||
- else if (((nVal >> 4) & 0x15) == 0x9)
|
||||
+ else if (nErrCodeL3 == 0x9)
|
||||
{
|
||||
nErrCode = DSL_ERR_L3_TIMED_OUT;
|
||||
}
|
Loading…
Reference in New Issue
Block a user