Skip to content

Commit

Permalink
Fixed rtw_memcpy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kelebek333 authored Apr 11, 2022
1 parent 8b6faa2 commit f55ee8f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
EXTRA_CFLAGS += -O1
#EXTRA_CFLAGS += -O3
#EXTRA_CFLAGS += -Wall
#EXTRA_CFLAGS += -Wextra
#EXTRA_CFLAGS += -Werror
#EXTRA_CFLAGS += -pedantic
#EXTRA_CFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes

EXTRA_CFLAGS += -Wno-unused-variable
EXTRA_CFLAGS += -Wno-unused-value
EXTRA_CFLAGS += -Wno-unused-label
EXTRA_CFLAGS += -Wno-unused-parameter
EXTRA_CFLAGS += -Wno-unused-function
EXTRA_CFLAGS += -Wno-unused
#EXTRA_CFLAGS += -Wno-uninitialized
EXTRA_CFLAGS += -Wno-vla -g
EXTRA_CFLAGS += -Wno-implicit-fallthrough

GCC_VER_49 := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc )
Expand Down
3 changes: 2 additions & 1 deletion core/efuse/rtw_efuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,13 +778,14 @@ void rtw_efuse_analyze(PADAPTER padapter, u8 Type, u8 Fake)
j = 0;

for (i = 0; i < mapLen; i++) {
if (i % 16 == 0)
if (i % 16 == 0) {
RTW_PRINT_SEL(RTW_DBGDUMP, "0x%03x: ", i);
_RTW_PRINT_SEL(RTW_DBGDUMP, "%02X%s"
, pEfuseHal->fakeEfuseInitMap[i]
, ((i + 1) % 16 == 0) ? "\n" : (((i + 1) % 8 == 0) ? " " : " ")
);
}
}
_RTW_PRINT_SEL(RTW_DBGDUMP, "\n");
if (eFuseWord)
rtw_mfree((u8 *)eFuseWord, EFUSE_MAX_SECTION_NUM * (EFUSE_MAX_WORD_UNIT * 2));
Expand Down
3 changes: 2 additions & 1 deletion core/rtw_mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -3119,10 +3119,11 @@ void rtw_drv_scan_by_self(_adapter *padapter, u8 reason)
#ifdef CONFIG_LAYER2_ROAMING
if (rtw_chk_roam_flags(padapter, RTW_ROAM_ACTIVE) && pmlmepriv->need_to_roam == _TRUE)
RTW_INFO(FUNC_ADPT_FMT" need to roam, don't care BusyTraffic\n", FUNC_ADPT_ARG(padapter));
else
else {
#endif
RTW_INFO(FUNC_ADPT_FMT" exit BusyTraffic\n", FUNC_ADPT_ARG(padapter));
goto exit;
}
}
else if (ssc_chk != SS_ALLOW)
goto exit;
Expand Down
3 changes: 2 additions & 1 deletion core/rtw_rf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1288,9 +1288,10 @@ void dump_txpwr_lmt(void *sel, _adapter *adapter)

RTW_PRINT_SEL(sel, "txpwr_lmt_2g_cck_ofdm_state:0x%02x\n", rfctl->txpwr_lmt_2g_cck_ofdm_state);
#ifdef CONFIG_IEEE80211_BAND_5GHZ
if (IS_HARDWARE_TYPE_JAGUAR_AND_JAGUAR2(adapter))
if (IS_HARDWARE_TYPE_JAGUAR_AND_JAGUAR2(adapter)) {
RTW_PRINT_SEL(sel, "txpwr_lmt_5g_cck_ofdm_state:0x%02x\n", rfctl->txpwr_lmt_5g_cck_ofdm_state);
RTW_PRINT_SEL(sel, "txpwr_lmt_5g_20_40_ref:0x%02x\n", rfctl->txpwr_lmt_5g_20_40_ref);
}
#endif
RTW_PRINT_SEL(sel, "\n");

Expand Down
4 changes: 4 additions & 0 deletions os_dep/linux/ioctl_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -9778,7 +9778,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 @@ -2491,7 +2491,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 f55ee8f

Please sign in to comment.