replace __attribute__ with fall through to support older versions of GCC

This commit is contained in:
kimocoder
2021-05-04 13:53:22 +02:00
parent acdcc1a06a
commit b83dea7877
5 changed files with 13 additions and 19 deletions

View File

@@ -10,10 +10,10 @@ EXTRA_CFLAGS += -Wno-unused
EXTRA_CFLAGS += -Wno-vla
EXTRA_CFLAGS += -Wno-date-time
REDHAT_VER := $(shell cut -f4 -d" " /etc/redhat-release |cut -d"." -f1,2 )
ifeq ($(REDHAT_VER), 7.9)
EXTRA_CFLAGS += -DRHEL79
endif
#REDHAT_VER := $(shell cut -f4 -d" " /etc/redhat-release |cut -d"." -f1,2 )
#ifeq ($(REDHAT_VER), 7.9)
#EXTRA_CFLAGS += -DRHEL79
#endif
GCC_VER_49 := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc )
ifeq ($(GCC_VER_49),1)

View File

@@ -1831,11 +1831,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
ptable->func = &OnAuth;
else
ptable->func = &OnAuthClient;
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
__attribute__ ((fallthrough));
#else
__attribute__ ((__fallthrough__));
#endif
/* fall through */
case WIFI_ASSOCREQ:
case WIFI_REASSOCREQ:
_mgt_dispatcher(padapter, ptable, precv_frame);

View File

@@ -939,8 +939,7 @@ s32 c2h_handler(_adapter *adapter, u8 id, u8 seq, u8 plen, u8 *payload)
#endif
case C2H_EXTEND:
sub_id = payload[0];
__attribute__ ((__fallthrough__));
/* fall through */
default:
if (phydm_c2H_content_parsing(adapter_to_phydm(adapter), id, plen, payload) != TRUE)
ret = _FAIL;

View File

@@ -2365,7 +2365,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
case NL80211_IFTYPE_P2P_CLIENT:
is_p2p = _TRUE;
#endif
__attribute__ ((__fallthrough__));
/* fall through */
case NL80211_IFTYPE_STATION:
networkType = Ndis802_11Infrastructure;
@@ -2390,7 +2390,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
case NL80211_IFTYPE_P2P_GO:
is_p2p = _TRUE;
#endif
__attribute__ ((__fallthrough__));
/* fall through */
case NL80211_IFTYPE_AP:
networkType = Ndis802_11APMode;

View File

@@ -10113,15 +10113,15 @@ static int rtw_priv_mp_get(struct net_device *dev,
RTW_INFO("mp_get EFUSE_MASK\n");
rtw_efuse_mask_file(dev, info, wdata, extra);
break;
case EFUSE_FILE:
case EFUSE_FILE:
RTW_INFO("mp_get EFUSE_FILE\n");
rtw_efuse_file_map(dev, info, wdata, extra);
break;
case MP_TX:
case MP_TX:
RTW_INFO("mp_get MP_TX\n");
rtw_mp_tx(dev, info, wdata, extra);
break;
case MP_RX:
case MP_RX:
RTW_INFO("mp_get MP_RX\n");
rtw_mp_rx(dev, info, wdata, extra);
break;
@@ -10143,11 +10143,11 @@ static int rtw_priv_mp_get(struct net_device *dev,
RTW_INFO("mp_get MP_SETPWRBYRATE\n");
rtw_mp_pwrbyrate(dev, info, wdata, extra);
break;
case BT_EFUSE_FILE:
case BT_EFUSE_FILE:
RTW_INFO("mp_get BT EFUSE_FILE\n");
rtw_bt_efuse_file_map(dev, info, wdata, extra);
break;
case MP_SWRFPath:
case MP_SWRFPath:
RTW_INFO("mp_get MP_SWRFPath\n");
rtw_mp_switch_rf_path(dev, info, wrqu, extra);
break;
@@ -10159,7 +10159,6 @@ static int rtw_priv_mp_get(struct net_device *dev,
}
#endif /*#if defined(CONFIG_MP_INCLUDED)*/
#ifdef CONFIG_SDIO_INDIRECT_ACCESS
#define DBG_MP_SDIO_INDIRECT_ACCESS 1
static int rtw_mp_sd_iread(struct net_device *dev