From 7ad5618762a9cc1b3fe42336550b324b6e5dfd39 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Mon, 11 Nov 2019 04:07:55 +0100 Subject: [PATCH] Fix build support to older GCCs by adding fallthroughs --- Makefile | 2 +- core/rtw_mlme_ext.c | 3 ++- hal/hal_intf.c | 8 ++++---- os_dep/linux/ioctl_cfg80211.c | 2 ++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index d21b974..69ad166 100755 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ EXTRA_CFLAGS += -Wno-uninitialized EXTRA_CFLAGS += -Wno-cast-function-type EXTRA_CFLAGS += -Wno-misleading-indentation EXTRA_CFLAGS += -Wno-missing-field-initializers -EXTRA_CFLAGS += -Wimplicit-fallthrough=0 +EXTRA_CFLAGS += -Wimplicit-fallthrough EXTRA_CFLAGS += -Wno-vla -g #EXTRA_CFLAGS += -Wno-tautological-compare #EXTRA_CFLAGS += -Wno-incompatible-pointer-types diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index c1ccd39..d4e679e 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -258,6 +258,7 @@ void rtw_txpwr_init_regd(struct rf_ctl_t *rfctl) ); if (rfctl->regd_name) break; + // Intentional fallthrough default: rfctl->regd_name = regd_str(TXPWR_LMT_WW); RTW_PRINT("assign %s for default case\n", regd_str(TXPWR_LMT_WW)); @@ -1342,7 +1343,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) ptable->func = &OnAuth; else ptable->func = &OnAuthClient; - /* pass through */ + // Intentional fallthrough case WIFI_ASSOCREQ: case WIFI_REASSOCREQ: _mgt_dispatcher(padapter, ptable, precv_frame); diff --git a/hal/hal_intf.c b/hal/hal_intf.c index 2d020fb..c30fa68 100644 --- a/hal/hal_intf.c +++ b/hal/hal_intf.c @@ -84,7 +84,7 @@ static void rtw_init_wireless_mode(_adapter *padapter) struct hal_spec_t *hal_spec = GET_HAL_SPEC(padapter); if(hal_spec->proto_cap & PROTO_CAP_11B) proto_wireless_mode |= WIRELESS_11B; - + if(hal_spec->proto_cap & PROTO_CAP_11G) proto_wireless_mode |= WIRELESS_11G; #ifdef CONFIG_80211AC_VHT @@ -103,7 +103,7 @@ static void rtw_init_wireless_mode(_adapter *padapter) #endif #ifdef CONFIG_80211AC_VHT - if(hal_spec->proto_cap & PROTO_CAP_11AC) + if(hal_spec->proto_cap & PROTO_CAP_11AC) proto_wireless_mode |= WIRELESS_11AC; #endif padapter->registrypriv.wireless_mode &= proto_wireless_mode; @@ -119,7 +119,7 @@ void rtw_hal_def_value_init(_adapter *padapter) padapter->hal_func.init_default_value(padapter); rtw_init_hal_com_default_value(padapter); - + #ifdef CONFIG_FW_MULTI_PORT_SUPPORT adapter_to_dvobj(padapter)->dft.port_id = 0xFF; adapter_to_dvobj(padapter)->dft.mac_id = 0xFF; @@ -1082,7 +1082,7 @@ s32 c2h_handler(_adapter *adapter, u8 id, u8 seq, u8 plen, u8 *payload) case C2H_EXTEND: sub_id = payload[0]; /* no handle, goto default */ - + // Intentional fallthrough default: if (phydm_c2H_content_parsing(adapter_to_phydm(adapter), id, plen, payload) != TRUE) ret = _FAIL; diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index e8572a4..bbe9832 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -2407,6 +2407,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy, case NL80211_IFTYPE_P2P_CLIENT: is_p2p = _TRUE; #endif + // Intentional fallthrough case NL80211_IFTYPE_STATION: networkType = Ndis802_11Infrastructure; @@ -2431,6 +2432,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy, case NL80211_IFTYPE_P2P_GO: is_p2p = _TRUE; #endif + // Intentional fallthrough case NL80211_IFTYPE_AP: networkType = Ndis802_11APMode;