Skip to content

Commit

Permalink
Fixes rtw_memcpy warnings (#4)
Browse files Browse the repository at this point in the history
Fixes some rtw_memcpy warnings on following files
ioctl_linux.c
osdep_service.c
  • Loading branch information
kelebek333 committed Apr 11, 2022
1 parent 02be310 commit 0d4e8e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions os_dep/linux/ioctl_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -9819,7 +9819,11 @@ static int rtw_mp_efuse_set(struct net_device *dev,
rtw_hal_read_chip_info(padapter);
/* set mac addr*/
rtw_macaddr_cfg(adapter_mac_addr(padapter), get_hal_mac_addr(padapter));
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
_rtw_memcpy(padapter->pnetdev->dev_addr, get_hal_mac_addr(padapter), ETH_ALEN); /* set mac addr to net_device */
#else
dev_addr_set(padapter->pnetdev, get_hal_mac_addr(padapter)); /* set mac addr to net_device */
#endif

#ifdef CONFIG_P2P
rtw_init_wifidirect_addrs(padapter, adapter_mac_addr(padapter), adapter_mac_addr(padapter));
Expand Down
4 changes: 4 additions & 0 deletions os_dep/osdep_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -2538,7 +2538,11 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname)

rtw_init_netdev_name(pnetdev, ifname);

#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
_rtw_memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN);
#else
dev_addr_set(pnetdev, adapter_mac_addr(padapter));
#endif

if (rtnl_lock_needed)
ret = register_netdev(pnetdev);
Expand Down

0 comments on commit 0d4e8e7

Please sign in to comment.