staging: rtl8188eu: ternary operator (?:) replaced by min/max kernel macro
min (or max) kernel macro better conveys the meaning of the code. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
66eaaf4d0d
commit
20e765310e
|
@ -292,8 +292,7 @@ static void rtl88eu_dm_hw_ant_div(struct odm_dm_struct *dm_odm)
|
|||
(dm_fat_tbl->AuxAnt_Sum[i]/dm_fat_tbl->AuxAnt_Cnt[i]) : 0;
|
||||
target_ant = (main_rssi >= aux_rssi) ? MAIN_ANT : AUX_ANT;
|
||||
/* 2 Select max_rssi for DIG */
|
||||
local_max_rssi = (main_rssi > aux_rssi) ?
|
||||
main_rssi : aux_rssi;
|
||||
local_max_rssi = max(main_rssi, aux_rssi);
|
||||
if ((local_max_rssi > ant_div_max_rssi) &&
|
||||
(local_max_rssi < 40))
|
||||
ant_div_max_rssi = local_max_rssi;
|
||||
|
@ -308,8 +307,7 @@ static void rtl88eu_dm_hw_ant_div(struct odm_dm_struct *dm_odm)
|
|||
(aux_rssi == 0))
|
||||
aux_rssi = main_rssi;
|
||||
|
||||
local_min_rssi = (main_rssi > aux_rssi) ?
|
||||
aux_rssi : main_rssi;
|
||||
local_min_rssi = min(main_rssi, aux_rssi);
|
||||
if (local_min_rssi < min_rssi) {
|
||||
min_rssi = local_min_rssi;
|
||||
RxIdleAnt = target_ant;
|
||||
|
|
|
@ -604,7 +604,7 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie
|
|||
if ((eid == _VENDOR_SPECIFIC_IE_) && (!memcmp(&buf[cnt+2], wps_oui, 4))) {
|
||||
DBG_88E("SET WPS_IE\n");
|
||||
|
||||
padapter->securitypriv.wps_ie_len = ((buf[cnt+1]+2) < (MAX_WPA_IE_LEN<<2)) ? (buf[cnt+1]+2) : (MAX_WPA_IE_LEN<<2);
|
||||
padapter->securitypriv.wps_ie_len = min(buf[cnt + 1] + 2, MAX_WPA_IE_LEN << 2);
|
||||
|
||||
memcpy(padapter->securitypriv.wps_ie, &buf[cnt], padapter->securitypriv.wps_ie_len);
|
||||
|
||||
|
@ -2974,7 +2974,7 @@ static int rtw_wx_set_priv(struct net_device *dev,
|
|||
|
||||
if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) &&
|
||||
(!memcmp(&probereq_wpsie[2], wps_oui, 4))) {
|
||||
cp_sz = probereq_wpsie_len > MAX_WPS_IE_LEN ? MAX_WPS_IE_LEN : probereq_wpsie_len;
|
||||
cp_sz = min(probereq_wpsie_len, MAX_WPS_IE_LEN);
|
||||
|
||||
pmlmepriv->wps_probe_req_ie_len = 0;
|
||||
kfree(pmlmepriv->wps_probe_req_ie);
|
||||
|
|
|
@ -52,7 +52,7 @@ uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen)
|
|||
|
||||
|
||||
len = rtw_remainder_len(pfile);
|
||||
len = (rlen > len) ? len : rlen;
|
||||
len = min(rlen, len);
|
||||
|
||||
if (rmem)
|
||||
skb_copy_bits(pfile->pkt, pfile->buf_len-pfile->pkt_len, rmem, len);
|
||||
|
|
Loading…
Reference in New Issue