mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-09 12:24:07 -05:00
qcacld-3.0: Fix logging signed integer cfg item
A signed integer cfg item if less that 32 bits is logged improperly i.e. the sign of the cfg item is being lost. Fix this by preserving the sign. Change-Id: I6eaba2bfa06d763bcdf197de0a4182c12c74d1af CRs-Fixed: 2033298
This commit is contained in:
parent
f36e060318
commit
53241c46d5
1 changed files with 11 additions and 0 deletions
|
|
@ -4441,12 +4441,23 @@ static QDF_STATUS hdd_cfg_get_config(struct reg_table_entry *reg_table,
|
|||
(WLAN_PARAM_SignedInteger == pRegEntry->RegType) ||
|
||||
(WLAN_PARAM_HexInteger == pRegEntry->RegType)) {
|
||||
value = 0;
|
||||
|
||||
if ((pRegEntry->VarSize > sizeof(value)) ||
|
||||
(pRegEntry->VarSize == 0)) {
|
||||
pr_warn("Invalid length of %s: %d",
|
||||
pRegEntry->RegName, pRegEntry->VarSize);
|
||||
continue;
|
||||
}
|
||||
|
||||
memcpy(&value, pField, pRegEntry->VarSize);
|
||||
if (WLAN_PARAM_HexInteger == pRegEntry->RegType) {
|
||||
fmt = "%x";
|
||||
} else if (WLAN_PARAM_SignedInteger ==
|
||||
pRegEntry->RegType) {
|
||||
fmt = "%d";
|
||||
value = sign_extend32(
|
||||
value,
|
||||
pRegEntry->VarSize * 8 - 1);
|
||||
} else {
|
||||
fmt = "%u";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue