staging: rtl8188eu: FIELD_OFFSET macro replaced by offsetof macro
FIELD_OFFSET and offsetof macro are equal Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2c10efbd07
commit
5e3027b653
|
@ -5061,7 +5061,7 @@ u8 createbss_hdl(struct adapter *padapter, u8 *pbuf)
|
||||||
/* clear CAM */
|
/* clear CAM */
|
||||||
flush_all_cam_entry(padapter);
|
flush_all_cam_entry(padapter);
|
||||||
|
|
||||||
memcpy(pnetwork, pbuf, FIELD_OFFSET(struct wlan_bssid_ex, IELength));
|
memcpy(pnetwork, pbuf, offsetof(struct wlan_bssid_ex, IELength));
|
||||||
pnetwork->IELength = ((struct wlan_bssid_ex *)pbuf)->IELength;
|
pnetwork->IELength = ((struct wlan_bssid_ex *)pbuf)->IELength;
|
||||||
|
|
||||||
if (pnetwork->IELength > MAX_IE_SZ)/* Check pbuf->IELength */
|
if (pnetwork->IELength > MAX_IE_SZ)/* Check pbuf->IELength */
|
||||||
|
@ -5120,7 +5120,7 @@ u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf)
|
||||||
pmlmeinfo->candidate_tid_bitmap = 0;
|
pmlmeinfo->candidate_tid_bitmap = 0;
|
||||||
pmlmeinfo->bwmode_updated = false;
|
pmlmeinfo->bwmode_updated = false;
|
||||||
|
|
||||||
memcpy(pnetwork, pbuf, FIELD_OFFSET(struct wlan_bssid_ex, IELength));
|
memcpy(pnetwork, pbuf, offsetof(struct wlan_bssid_ex, IELength));
|
||||||
pnetwork->IELength = ((struct wlan_bssid_ex *)pbuf)->IELength;
|
pnetwork->IELength = ((struct wlan_bssid_ex *)pbuf)->IELength;
|
||||||
|
|
||||||
if (pnetwork->IELength > MAX_IE_SZ)/* Check pbuf->IELength */
|
if (pnetwork->IELength > MAX_IE_SZ)/* Check pbuf->IELength */
|
||||||
|
|
|
@ -135,9 +135,9 @@ struct registry_priv {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* For registry parameters */
|
/* For registry parameters */
|
||||||
#define RGTRY_OFT(field) ((u32)FIELD_OFFSET(struct registry_priv, field))
|
#define RGTRY_OFT(field) ((u32)offsetof(struct registry_priv, field))
|
||||||
#define RGTRY_SZ(field) sizeof(((struct registry_priv *)0)->field)
|
#define RGTRY_SZ(field) sizeof(((struct registry_priv *)0)->field)
|
||||||
#define BSSID_OFT(field) ((u32)FIELD_OFFSET(struct wlan_bssid_ex, field))
|
#define BSSID_OFT(field) ((u32)offsetofT(struct wlan_bssid_ex, field))
|
||||||
#define BSSID_SZ(field) sizeof(((struct wlan_bssid_ex *)0)->field)
|
#define BSSID_SZ(field) sizeof(((struct wlan_bssid_ex *)0)->field)
|
||||||
|
|
||||||
#define MAX_CONTINUAL_URB_ERR 4
|
#define MAX_CONTINUAL_URB_ERR 4
|
||||||
|
|
|
@ -403,7 +403,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
|
||||||
|
|
||||||
if (wep_key_len > 0) {
|
if (wep_key_len > 0) {
|
||||||
wep_key_len = wep_key_len <= 5 ? 5 : 13;
|
wep_key_len = wep_key_len <= 5 ? 5 : 13;
|
||||||
wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
|
wep_total_len = wep_key_len + offsetof(struct ndis_802_11_wep, KeyMaterial);
|
||||||
pwep = (struct ndis_802_11_wep *)rtw_malloc(wep_total_len);
|
pwep = (struct ndis_802_11_wep *)rtw_malloc(wep_total_len);
|
||||||
if (pwep == NULL) {
|
if (pwep == NULL) {
|
||||||
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, (" wpa_set_encryption: pwep allocate fail !!!\n"));
|
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, (" wpa_set_encryption: pwep allocate fail !!!\n"));
|
||||||
|
@ -1677,7 +1677,7 @@ static int rtw_wx_set_enc(struct net_device *dev,
|
||||||
if (erq->length > 0) {
|
if (erq->length > 0) {
|
||||||
wep.KeyLength = erq->length <= 5 ? 5 : 13;
|
wep.KeyLength = erq->length <= 5 ? 5 : 13;
|
||||||
|
|
||||||
wep.Length = wep.KeyLength + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
|
wep.Length = wep.KeyLength + offsetof(struct ndis_802_11_wep, KeyMaterial);
|
||||||
} else {
|
} else {
|
||||||
wep.KeyLength = 0;
|
wep.KeyLength = 0;
|
||||||
|
|
||||||
|
@ -2277,7 +2277,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param,
|
||||||
|
|
||||||
if (wep_key_len > 0) {
|
if (wep_key_len > 0) {
|
||||||
wep_key_len = wep_key_len <= 5 ? 5 : 13;
|
wep_key_len = wep_key_len <= 5 ? 5 : 13;
|
||||||
wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
|
wep_total_len = wep_key_len + offsetof(struct ndis_802_11_wep, KeyMaterial);
|
||||||
pwep = (struct ndis_802_11_wep *)rtw_malloc(wep_total_len);
|
pwep = (struct ndis_802_11_wep *)rtw_malloc(wep_total_len);
|
||||||
if (pwep == NULL) {
|
if (pwep == NULL) {
|
||||||
DBG_88E(" r871x_set_encryption: pwep allocate fail !!!\n");
|
DBG_88E(" r871x_set_encryption: pwep allocate fail !!!\n");
|
||||||
|
|
Loading…
Reference in a new issue