From 996c802250a7373e6ffd0a4d4798c4c2c9f71487 Mon Sep 17 00:00:00 2001 From: Harry Youd <harry@harryyoud.co.uk> Date: Sun, 25 Aug 2019 09:40:15 +0100 Subject: [PATCH] Fix some warnings --- 3rdparty/rtl8821ce/Makefile | 1 + 3rdparty/rtl8821ce/core/rtw_ap.c | 2 +- 3rdparty/rtl8821ce/core/rtw_mlme_ext.c | 3 ++- 3rdparty/rtl8821ce/hal/hal_halmac.c | 2 +- 3rdparty/rtl8821ce/hal/hal_intf.c | 3 +-- 3rdparty/rtl8821ce/hal/halmac/halmac_88xx/halmac_mimo_88xx.c | 2 ++ 3rdparty/rtl8821ce/hal/phydm/halrf/rtl8821c/halrf_iqk_8821c.c | 4 ++-- 3rdparty/rtl8821ce/os_dep/linux/ioctl_cfg80211.c | 2 ++ 8 files changed, 12 insertions(+), 7 deletions(-) diff -Nurp ./3rdparty/rtl8821ce.orig/core/rtw_ap.c ./3rdparty/rtl8821ce/core/rtw_ap.c --- ./3rdparty/rtl8821ce.orig/core/rtw_ap.c 2019-10-16 00:25:48.724975192 +0300 +++ ./3rdparty/rtl8821ce/core/rtw_ap.c 2019-10-17 14:09:22.715626965 +0300 @@ -171,7 +171,7 @@ void rtw_add_bcn_ie(_adapter *padapter, u8 bmatch = _FALSE; u8 *pie = pnetwork->IEs; u8 *p = NULL, *dst_ie = NULL, *premainder_ie = NULL, *pbackup_remainder_ie = NULL; - u32 i, offset, ielen, ie_offset, remainder_ielen = 0; + u32 i = 0, offset = 0, ielen = 0, ie_offset = 0, remainder_ielen = 0; for (i = sizeof(NDIS_802_11_FIXED_IEs); i < pnetwork->IELength;) { pIE = (PNDIS_802_11_VARIABLE_IEs)(pnetwork->IEs + i); diff -Nurp ./3rdparty/rtl8821ce.orig/core/rtw_mlme_ext.c ./3rdparty/rtl8821ce/core/rtw_mlme_ext.c --- ./3rdparty/rtl8821ce.orig/core/rtw_mlme_ext.c 2019-10-16 00:25:48.733975191 +0300 +++ ./3rdparty/rtl8821ce/core/rtw_mlme_ext.c 2019-10-17 14:09:22.716626965 +0300 @@ -258,6 +258,7 @@ void rtw_txpwr_init_regd(struct rf_ctl_t ); if (rfctl->regd_name) break; + __attribute__ ((fallthrough)); default: rfctl->regd_name = regd_str(TXPWR_LMT_WW); RTW_PRINT("assign %s for default case\n", regd_str(TXPWR_LMT_WW)); @@ -1327,7 +1328,7 @@ void mgt_dispatcher(_adapter *padapter, ptable->func = &OnAuth; else ptable->func = &OnAuthClient; - /* pass through */ + __attribute__ ((fallthrough)); case WIFI_ASSOCREQ: case WIFI_REASSOCREQ: _mgt_dispatcher(padapter, ptable, precv_frame); diff -Nurp ./3rdparty/rtl8821ce.orig/hal/hal_halmac.c ./3rdparty/rtl8821ce/hal/hal_halmac.c --- ./3rdparty/rtl8821ce.orig/hal/hal_halmac.c 2019-10-16 00:25:48.750975190 +0300 +++ ./3rdparty/rtl8821ce/hal/hal_halmac.c 2019-10-17 14:09:22.716626965 +0300 @@ -2900,7 +2900,7 @@ static int _send_general_info(struct dvo case HALMAC_RET_NO_DLFW: RTW_WARN("%s: halmac_send_general_info() fail because fw not dl!\n", __FUNCTION__); - /* go through */ + __attribute__ ((fallthrough)); default: return -1; } diff -Nurp ./3rdparty/rtl8821ce.orig/hal/hal_intf.c ./3rdparty/rtl8821ce/hal/hal_intf.c --- ./3rdparty/rtl8821ce.orig/hal/hal_intf.c 2019-10-16 00:25:48.751975190 +0300 +++ ./3rdparty/rtl8821ce/hal/hal_intf.c 2019-10-17 14:09:22.716626965 +0300 @@ -1070,8 +1070,7 @@ s32 c2h_handler(_adapter *adapter, u8 id #endif case C2H_EXTEND: sub_id = payload[0]; - /* no handle, goto default */ - + __attribute__ ((fallthrough)); default: if (phydm_c2H_content_parsing(adapter_to_phydm(adapter), id, plen, payload) != TRUE) ret = _FAIL; diff -Nurp ./3rdparty/rtl8821ce.orig/hal/halmac/halmac_88xx/halmac_mimo_88xx.c ./3rdparty/rtl8821ce/hal/halmac/halmac_88xx/halmac_mimo_88xx.c --- ./3rdparty/rtl8821ce.orig/hal/halmac/halmac_88xx/halmac_mimo_88xx.c 2019-10-16 00:25:48.755975190 +0300 +++ ./3rdparty/rtl8821ce/hal/halmac/halmac_88xx/halmac_mimo_88xx.c 2019-10-17 14:09:22.717626965 +0300 @@ -62,8 +62,10 @@ cfg_txbf_88xx(struct halmac_adapter *ada switch (bw) { case HALMAC_BW_80: tmp42c |= BIT_R_TXBF0_80M; + __attribute__ ((fallthrough)); case HALMAC_BW_40: tmp42c |= BIT_R_TXBF0_40M; + __attribute__ ((fallthrough)); case HALMAC_BW_20: tmp42c |= BIT_R_TXBF0_20M; break; diff -Nurp ./3rdparty/rtl8821ce.orig/hal/phydm/halrf/rtl8821c/halrf_iqk_8821c.c ./3rdparty/rtl8821ce/hal/phydm/halrf/rtl8821c/halrf_iqk_8821c.c --- ./3rdparty/rtl8821ce.orig/hal/phydm/halrf/rtl8821c/halrf_iqk_8821c.c 2019-10-16 00:25:48.806975187 +0300 +++ ./3rdparty/rtl8821ce/hal/phydm/halrf/rtl8821c/halrf_iqk_8821c.c 2019-10-17 14:09:22.717626965 +0300 @@ -576,9 +576,9 @@ void _iqk_reload_iqk_setting_8821c(struc odm_write_4byte(dm, 0x1bd8, ((0xc0000000 >> idx) + 0x1) + (i * 4) + (iqk_info->iqk_cfir_imag[channel][path][idx][i] << 9)); } if (idx == 0) - odm_set_bb_reg(dm, iqk_apply[path], BIT(0), ~(iqk_info->iqk_fail_report[channel][path][idx])); + odm_set_bb_reg(dm, iqk_apply[path], BIT(0), ~(u32)(iqk_info->iqk_fail_report[channel][path][idx])); else - odm_set_bb_reg(dm, iqk_apply[path], BIT(10), ~(iqk_info->iqk_fail_report[channel][path][idx])); + odm_set_bb_reg(dm, iqk_apply[path], BIT(10), ~(u32)(iqk_info->iqk_fail_report[channel][path][idx])); } odm_set_bb_reg(dm, R_0x1bd8, MASKDWORD, 0x0); odm_set_bb_reg(dm, R_0x1b0c, BIT(13) | BIT(12), 0x0); diff -Nurp ./3rdparty/rtl8821ce.orig/Makefile ./3rdparty/rtl8821ce/Makefile --- ./3rdparty/rtl8821ce.orig/Makefile 2019-10-16 00:25:48.869975183 +0300 +++ ./3rdparty/rtl8821ce/Makefile 2019-10-17 14:09:22.715626965 +0300 @@ -7,6 +7,7 @@ EXTRA_CFLAGS += -O1 #EXTRA_CFLAGS += -pedantic #EXTRA_CFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes +EXTRA_CFLAGS += -Wno-vla EXTRA_CFLAGS += -Wno-unused-variable EXTRA_CFLAGS += -Wno-unused-value EXTRA_CFLAGS += -Wno-unused-label diff -Nurp ./3rdparty/rtl8821ce.orig/os_dep/linux/ioctl_cfg80211.c ./3rdparty/rtl8821ce/os_dep/linux/ioctl_cfg80211.c --- ./3rdparty/rtl8821ce.orig/os_dep/linux/ioctl_cfg80211.c 2019-10-16 00:25:48.857975184 +0300 +++ ./3rdparty/rtl8821ce/os_dep/linux/ioctl_cfg80211.c 2019-10-17 14:09:22.717626965 +0300 @@ -2350,6 +2350,7 @@ static int cfg80211_rtw_change_iface(str #if defined(CONFIG_P2P) && ((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)) case NL80211_IFTYPE_P2P_CLIENT: is_p2p = _TRUE; + __attribute__ ((fallthrough)); #endif case NL80211_IFTYPE_STATION: networkType = Ndis802_11Infrastructure; @@ -2374,6 +2375,7 @@ static int cfg80211_rtw_change_iface(str #if defined(CONFIG_P2P) && ((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)) case NL80211_IFTYPE_P2P_GO: is_p2p = _TRUE; + __attribute__ ((fallthrough)); #endif case NL80211_IFTYPE_AP: networkType = Ndis802_11APMode;