mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-16 09:50:26 +00:00
57 lines
2.3 KiB
Diff
57 lines
2.3 KiB
Diff
|
From 51ab9d6a959de87206731f941b1df39e5c5d63ea Mon Sep 17 00:00:00 2001
|
||
|
From: Christian Marangi <ansuelsmth@gmail.com>
|
||
|
Date: Sun, 30 Jul 2023 11:21:49 +0200
|
||
|
Subject: [PATCH 4/5] treewide: drop const from dev_addr
|
||
|
|
||
|
dev_addr is not const and conflict with memcpy function. Fix compilation
|
||
|
warning by casting dev_addr to void*.
|
||
|
|
||
|
This operation is safe as this is done before netdev register.
|
||
|
|
||
|
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||
|
---
|
||
|
os_dep/linux/os_intfs.c | 6 +++---
|
||
|
os_dep/osdep_service.c | 2 +-
|
||
|
2 files changed, 4 insertions(+), 4 deletions(-)
|
||
|
|
||
|
--- a/os_dep/linux/os_intfs.c
|
||
|
+++ b/os_dep/linux/os_intfs.c
|
||
|
@@ -1885,7 +1885,7 @@ int _netdev_if2_open(struct net_device *
|
||
|
|
||
|
_rtw_memcpy(padapter->eeprompriv.mac_addr, mac, ETH_ALEN);
|
||
|
rtw_init_wifidirect_addrs(padapter, padapter->eeprompriv.mac_addr, padapter->eeprompriv.mac_addr);
|
||
|
- _rtw_memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
|
||
|
+ _rtw_memcpy((void *)pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
|
||
|
}
|
||
|
#endif //CONFIG_PLATFORM_INTEL_BYT
|
||
|
|
||
|
@@ -2254,7 +2254,7 @@ static int _rtw_drv_register_netdev(_ada
|
||
|
/* alloc netdev name */
|
||
|
rtw_init_netdev_name(pnetdev, name);
|
||
|
|
||
|
- _rtw_memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
|
||
|
+ _rtw_memcpy((void *)pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
|
||
|
|
||
|
/* Tell the network stack we exist */
|
||
|
if (register_netdev(pnetdev) != 0) {
|
||
|
@@ -2334,7 +2334,7 @@ int _netdev_open(struct net_device *pnet
|
||
|
#ifdef CONFIG_PLATFORM_INTEL_BYT
|
||
|
rtw_macaddr_cfg(padapter->eeprompriv.mac_addr);
|
||
|
rtw_init_wifidirect_addrs(padapter, padapter->eeprompriv.mac_addr, padapter->eeprompriv.mac_addr);
|
||
|
- _rtw_memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
|
||
|
+ _rtw_memcpy((void *)pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
|
||
|
#endif //CONFIG_PLATFORM_INTEL_BYT
|
||
|
|
||
|
padapter->bDriverStopped = _FALSE;
|
||
|
--- a/os_dep/osdep_service.c
|
||
|
+++ b/os_dep/osdep_service.c
|
||
|
@@ -2209,7 +2209,7 @@ int rtw_change_ifname(_adapter *padapter
|
||
|
|
||
|
rtw_init_netdev_name(pnetdev, ifname);
|
||
|
|
||
|
- _rtw_memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
|
||
|
+ _rtw_memcpy((void *)pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
|
||
|
|
||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
|
||
|
if(!rtnl_is_locked())
|