Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8723bs: replace FIELD_OFFSET usage with offsetof in rtw_mlme_ext.c

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>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20251125112059.16913-5-knavaneeth786@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Navaneeth K and committed by
Greg Kroah-Hartman
d82c5681 2cbcfd3f

+2 -2
+2 -2
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
··· 5244 5244 /* clear CAM */ 5245 5245 flush_all_cam_entry(padapter); 5246 5246 5247 - memcpy(pnetwork, pbuf, FIELD_OFFSET(struct wlan_bssid_ex, ie_length)); 5247 + memcpy(pnetwork, pbuf, offsetof(struct wlan_bssid_ex, ie_length)); 5248 5248 pnetwork->ie_length = ((struct wlan_bssid_ex *)pbuf)->ie_length; 5249 5249 5250 5250 if (pnetwork->ie_length > MAX_IE_SZ)/* Check pbuf->ie_length */ ··· 5308 5308 /* pmlmeinfo->assoc_AP_vendor = HT_IOT_PEER_MAX; */ 5309 5309 pmlmeinfo->VHT_enable = 0; 5310 5310 5311 - memcpy(pnetwork, pbuf, FIELD_OFFSET(struct wlan_bssid_ex, ie_length)); 5311 + memcpy(pnetwork, pbuf, offsetof(struct wlan_bssid_ex, ie_length)); 5312 5312 pnetwork->ie_length = ((struct wlan_bssid_ex *)pbuf)->ie_length; 5313 5313 5314 5314 if (pnetwork->ie_length > MAX_IE_SZ)/* Check pbuf->ie_length */