mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
qcacld-3.0: Do range check only if ini value is set from the file
For some of the configurations, the default is not one of the in-range values because we want to detect if the value has been set or not. Hence, do the range check when a value is present in the cfg.ini. Change-Id: I4db722ed5053e2248dc23c7417d192fe6093ee46 CRs-Fixed: 2014145
This commit is contained in:
parent
70e169a798
commit
d1b925870d
1 changed files with 14 additions and 10 deletions
|
|
@ -4649,8 +4649,9 @@ static QDF_STATUS hdd_apply_cfg_ini(hdd_context_t *pHddCtx,
|
|||
value = pRegEntry->VarDefault;
|
||||
}
|
||||
|
||||
/* If this parameter needs range checking, do it here. */
|
||||
if (pRegEntry->Flags & VAR_FLAGS_RANGE_CHECK) {
|
||||
/* Only if the parameter is set in the ini file, do the range check here */
|
||||
if (match_status == QDF_STATUS_SUCCESS &&
|
||||
pRegEntry->Flags & VAR_FLAGS_RANGE_CHECK) {
|
||||
if (value > pRegEntry->VarMax) {
|
||||
hdd_err("Reg Parameter %s > allowed Maximum [%u > %lu]. Enforcing Maximum", pRegEntry->RegName,
|
||||
value, pRegEntry->VarMax);
|
||||
|
|
@ -4663,9 +4664,10 @@ static QDF_STATUS hdd_apply_cfg_ini(hdd_context_t *pHddCtx,
|
|||
value = pRegEntry->VarMin;
|
||||
}
|
||||
}
|
||||
/* If this parameter needs range checking, do it here. */
|
||||
else if (pRegEntry->
|
||||
Flags & VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT) {
|
||||
/* Only if the parameter is set in the ini file, do the range check here */
|
||||
else if (match_status == QDF_STATUS_SUCCESS &&
|
||||
pRegEntry->Flags &
|
||||
VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT) {
|
||||
if (value > pRegEntry->VarMax) {
|
||||
hdd_err("Reg Parameter %s > allowed Maximum [%u > %lu]. Enforcing Default= %lu", pRegEntry->RegName,
|
||||
value, pRegEntry->VarMax,
|
||||
|
|
@ -4697,8 +4699,9 @@ static QDF_STATUS hdd_apply_cfg_ini(hdd_context_t *pHddCtx,
|
|||
svalue = (int32_t) pRegEntry->VarDefault;
|
||||
}
|
||||
|
||||
/* If this parameter needs range checking, do it here. */
|
||||
if (pRegEntry->Flags & VAR_FLAGS_RANGE_CHECK) {
|
||||
/* Only if the parameter is set in the ini file, do the range check here */
|
||||
if (match_status == QDF_STATUS_SUCCESS &&
|
||||
pRegEntry->Flags & VAR_FLAGS_RANGE_CHECK) {
|
||||
if (svalue > (int32_t) pRegEntry->VarMax) {
|
||||
hdd_err("Reg Parameter %s > allowed Maximum "
|
||||
"[%d > %d]. Enforcing Maximum", pRegEntry->RegName,
|
||||
|
|
@ -4713,9 +4716,10 @@ static QDF_STATUS hdd_apply_cfg_ini(hdd_context_t *pHddCtx,
|
|||
svalue = (int32_t) pRegEntry->VarMin;
|
||||
}
|
||||
}
|
||||
/* If this parameter needs range checking, do it here. */
|
||||
else if (pRegEntry->
|
||||
Flags & VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT) {
|
||||
/* Only if the parameter is set in the ini file, do the range check here */
|
||||
else if (match_status == QDF_STATUS_SUCCESS &&
|
||||
pRegEntry->Flags &
|
||||
VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT) {
|
||||
if (svalue > (int32_t) pRegEntry->VarMax) {
|
||||
hdd_err("Reg Parameter %s > allowed Maximum "
|
||||
"[%d > %d]. Enforcing Default= %d", pRegEntry->RegName,
|
||||
|
|
|
|||
Loading…
Reference in a new issue