Commit b812982e authored by Kristina Martšenko's avatar Kristina Martšenko Committed by Peter P Waskiewicz Jr

staging: rtl8188eu: explicitly convert from __le16 to integer

BA_para_set (of type __le16) is implicitly cast into an integer for
bitwise operations, after which the result is converted back into a
__le16. Make the initial cast explicit to make the code clearer. In
addition, refactor the code for readability.

This also removes five sparse warnings of the following type:
drivers/staging/rtl8188eu//core/rtw_mlme_ext.c:6114:70: warning: restricted __le16 degrades to integer
Signed-off-by: default avatarKristina Martšenko <kristina.martsenko@gmail.com>
Signed-off-by: default avatarPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
parent 17e65fbb
......@@ -6109,17 +6109,26 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch
case 1: /* ADDBA rsp */
pframe = rtw_set_fixed_ie(pframe, 1, &(pmlmeinfo->ADDBA_req.dialog_token), &(pattrib->pktlen));
pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&status), &(pattrib->pktlen));
BA_para_set = le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f;
rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor);
if (MAX_AMPDU_FACTOR_64K == max_rx_ampdu_factor)
BA_para_set = (((pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); /* 64 buffer size */
else if (MAX_AMPDU_FACTOR_32K == max_rx_ampdu_factor)
BA_para_set = (((pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0800); /* 32 buffer size */
else if (MAX_AMPDU_FACTOR_16K == max_rx_ampdu_factor)
BA_para_set = (((pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0400); /* 16 buffer size */
else if (MAX_AMPDU_FACTOR_8K == max_rx_ampdu_factor)
BA_para_set = (((pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0200); /* 8 buffer size */
else
BA_para_set = (((pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); /* 64 buffer size */
switch (max_rx_ampdu_factor) {
case MAX_AMPDU_FACTOR_64K:
BA_para_set |= 0x1000; /* 64 buffer size */
break;
case MAX_AMPDU_FACTOR_32K:
BA_para_set |= 0x0800; /* 32 buffer size */
break;
case MAX_AMPDU_FACTOR_16K:
BA_para_set |= 0x0400; /* 16 buffer size */
break;
case MAX_AMPDU_FACTOR_8K:
BA_para_set |= 0x0200; /* 8 buffer size */
break;
default:
BA_para_set |= 0x1000; /* 64 buffer size */
break;
}
if (pregpriv->ampdu_amsdu == 0)/* disabled */
BA_para_set = BA_para_set & ~BIT(0);
......
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