Commit fbb052f9 authored by Mateusz Kulikowski's avatar Mateusz Kulikowski Committed by Greg Kroah-Hartman

staging: rtl8192e: Fix DEEP_INDENTATION warnings in rtllib_parse_info_param()

- Replace ?: with min_t
- Remove condition that is always true
Signed-off-by: default avatarMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 867ebbae
...@@ -1927,8 +1927,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, ...@@ -1927,8 +1927,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
tmp_htcap_len = min_t(u8, info_element->len, MAX_IE_LEN); tmp_htcap_len = min_t(u8, info_element->len, MAX_IE_LEN);
if (tmp_htcap_len != 0) { if (tmp_htcap_len != 0) {
network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC;
network->bssht.bdHTCapLen = tmp_htcap_len > sizeof(network->bssht.bdHTCapBuf) ? network->bssht.bdHTCapLen = min_t(u16, tmp_htcap_len, sizeof(network->bssht.bdHTCapBuf));
sizeof(network->bssht.bdHTCapBuf) : tmp_htcap_len;
memcpy(network->bssht.bdHTCapBuf, info_element->data, network->bssht.bdHTCapLen); memcpy(network->bssht.bdHTCapBuf, info_element->data, network->bssht.bdHTCapLen);
} }
} }
...@@ -1951,15 +1950,11 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, ...@@ -1951,15 +1950,11 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
tmp_htinfo_len = min_t(u8, info_element->len, MAX_IE_LEN); tmp_htinfo_len = min_t(u8, info_element->len, MAX_IE_LEN);
if (tmp_htinfo_len != 0) { if (tmp_htinfo_len != 0) {
network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC;
if (tmp_htinfo_len) { network->bssht.bdHTInfoLen = min_t(u16, tmp_htinfo_len, sizeof(network->bssht.bdHTInfoBuf));
network->bssht.bdHTInfoLen = tmp_htinfo_len > sizeof(network->bssht.bdHTInfoBuf) ?
sizeof(network->bssht.bdHTInfoBuf) : tmp_htinfo_len;
memcpy(network->bssht.bdHTInfoBuf, info_element->data, network->bssht.bdHTInfoLen); memcpy(network->bssht.bdHTInfoBuf, info_element->data, network->bssht.bdHTInfoLen);
} }
} }
}
} }
if (ieee->aggregation) { if (ieee->aggregation) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment