mirror of https://gitee.com/openkylin/linux.git
staging: rtl8192e: Replace min with min_t
This patch replaces min with min_t and eliminates the following warnings found by checkpatch.pl: WARNING: min() should probably be min_t Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a3d81a379b
commit
d009f0d7ae
|
@ -1904,7 +1904,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
|
||||||
info_element->data[2] == 0x4c &&
|
info_element->data[2] == 0x4c &&
|
||||||
info_element->data[3] == 0x033) {
|
info_element->data[3] == 0x033) {
|
||||||
|
|
||||||
tmp_htcap_len = min(info_element->len, (u8)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 = tmp_htcap_len > sizeof(network->bssht.bdHTCapBuf) ?
|
||||||
|
@ -1928,7 +1928,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
|
||||||
info_element->data[1] == 0x90 &&
|
info_element->data[1] == 0x90 &&
|
||||||
info_element->data[2] == 0x4c &&
|
info_element->data[2] == 0x4c &&
|
||||||
info_element->data[3] == 0x034) {
|
info_element->data[3] == 0x034) {
|
||||||
tmp_htinfo_len = min(info_element->len, (u8)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) {
|
if (tmp_htinfo_len) {
|
||||||
|
@ -1949,7 +1949,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
|
||||||
info_element->data[1] == 0xe0 &&
|
info_element->data[1] == 0xe0 &&
|
||||||
info_element->data[2] == 0x4c &&
|
info_element->data[2] == 0x4c &&
|
||||||
info_element->data[3] == 0x02) {
|
info_element->data[3] == 0x02) {
|
||||||
ht_realtek_agg_len = min(info_element->len, (u8)MAX_IE_LEN);
|
ht_realtek_agg_len = min_t(u8, info_element->len, MAX_IE_LEN);
|
||||||
memcpy(ht_realtek_agg_buf, info_element->data, info_element->len);
|
memcpy(ht_realtek_agg_buf, info_element->data, info_element->len);
|
||||||
}
|
}
|
||||||
if (ht_realtek_agg_len >= 5) {
|
if (ht_realtek_agg_len >= 5) {
|
||||||
|
@ -2079,7 +2079,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
|
||||||
case MFIE_TYPE_HT_CAP:
|
case MFIE_TYPE_HT_CAP:
|
||||||
RTLLIB_DEBUG_SCAN("MFIE_TYPE_HT_CAP: %d bytes\n",
|
RTLLIB_DEBUG_SCAN("MFIE_TYPE_HT_CAP: %d bytes\n",
|
||||||
info_element->len);
|
info_element->len);
|
||||||
tmp_htcap_len = min(info_element->len, (u8)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 = tmp_htcap_len > sizeof(network->bssht.bdHTCapBuf) ?
|
||||||
|
@ -2106,7 +2106,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
|
||||||
case MFIE_TYPE_HT_INFO:
|
case MFIE_TYPE_HT_INFO:
|
||||||
RTLLIB_DEBUG_SCAN("MFIE_TYPE_HT_INFO: %d bytes\n",
|
RTLLIB_DEBUG_SCAN("MFIE_TYPE_HT_INFO: %d bytes\n",
|
||||||
info_element->len);
|
info_element->len);
|
||||||
tmp_htinfo_len = min(info_element->len, (u8)MAX_IE_LEN);
|
tmp_htinfo_len = min_t(u8, info_element->len, MAX_IE_LEN);
|
||||||
if (tmp_htinfo_len) {
|
if (tmp_htinfo_len) {
|
||||||
network->bssht.bdHTSpecVer = HT_SPEC_VER_IEEE;
|
network->bssht.bdHTSpecVer = HT_SPEC_VER_IEEE;
|
||||||
network->bssht.bdHTInfoLen = tmp_htinfo_len >
|
network->bssht.bdHTInfoLen = tmp_htinfo_len >
|
||||||
|
|
|
@ -74,7 +74,7 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
|
||||||
iwe.cmd = SIOCGIWESSID;
|
iwe.cmd = SIOCGIWESSID;
|
||||||
iwe.u.data.flags = 1;
|
iwe.u.data.flags = 1;
|
||||||
if (network->ssid_len > 0) {
|
if (network->ssid_len > 0) {
|
||||||
iwe.u.data.length = min(network->ssid_len, (u8)32);
|
iwe.u.data.length = min_t(u8, network->ssid_len, 32);
|
||||||
start = iwe_stream_add_point_rsl(info, start, stop, &iwe,
|
start = iwe_stream_add_point_rsl(info, start, stop, &iwe,
|
||||||
network->ssid);
|
network->ssid);
|
||||||
} else if (network->hidden_ssid_len == 0) {
|
} else if (network->hidden_ssid_len == 0) {
|
||||||
|
@ -82,7 +82,7 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
|
||||||
start = iwe_stream_add_point_rsl(info, start, stop,
|
start = iwe_stream_add_point_rsl(info, start, stop,
|
||||||
&iwe, "<hidden>");
|
&iwe, "<hidden>");
|
||||||
} else {
|
} else {
|
||||||
iwe.u.data.length = min(network->hidden_ssid_len, (u8)32);
|
iwe.u.data.length = min_t(u8, network->hidden_ssid_len, 32);
|
||||||
start = iwe_stream_add_point_rsl(info, start, stop, &iwe,
|
start = iwe_stream_add_point_rsl(info, start, stop, &iwe,
|
||||||
network->hidden_ssid);
|
network->hidden_ssid);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue