[PATCH v2 4/5] staging: rtl8723bs: replace FIELD_OFFSET usage with offsetof in rtw_mlme_ext.c

Navaneeth K
2025-11-25T11:21:22Z

Replace usage of the custom FIELD_OFFSET macro with the standard
offsetof() macro in rtw_mlme_ext.c. This improves code readability
and uses the kernel's standard mechanism.

Signed-off-by: Navaneeth K <knavaneeth786@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index a897c433d2b0..9372b997fc23 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -5275,7 +5275,7 @@ u8 createbss_hdl(struct adapter *padapter, u8 *pbuf)
/* clear CAM */
flush_all_cam_entry(padapter);

- memcpy(pnetwork, pbuf, FIELD_OFFSET(struct wlan_bssid_ex, ie_length));
+ memcpy(pnetwork, pbuf, offsetof(struct wlan_bssid_ex, ie_length));
pnetwork->ie_length = ((struct wlan_bssid_ex *)pbuf)->ie_length;

if (pnetwork->ie_length > MAX_IE_SZ)/* Check pbuf->ie_length */
@@ -5339,7 +5339,7 @@ u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf)
/* pmlmeinfo->assoc_AP_vendor = HT_IOT_PEER_MAX; */
pmlmeinfo->VHT_enable = 0;

- memcpy(pnetwork, pbuf, FIELD_OFFSET(struct wlan_bssid_ex, ie_length));
+ memcpy(pnetwork, pbuf, offsetof(struct wlan_bssid_ex, ie_length));
pnetwork->ie_length = ((struct wlan_bssid_ex *)pbuf)->ie_length;

if (pnetwork->ie_length > MAX_IE_SZ)/* Check pbuf->ie_length */
--
2.43.0