Skip to content

Commit

Permalink
Replace fall-through comments by attributes
Browse files Browse the repository at this point in the history
The commit b7eb335e26a9c7f258c96b3962c283c379d3ede0 in the Linux Kernel
enabled strict implicit fall through warnings. As it is used there (and
thus here too), fall-through comments are ignored. The fall-through
attribute has to be used.

This commit changes all fall-through comments into __attribute__
declarations. With that, the explicit fall-throughs are recognised as
such again.
  • Loading branch information
MaxG87 committed Sep 8, 2021
1 parent 7c446fa commit 6aa9651
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions core/rtw_mlme_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ void rtw_txpwr_init_regd(struct rf_ctl_t *rfctl)
);
if (rfctl->regd_name)
break;
/* fall through */
__attribute__((__fallthrough__));
default:
rfctl->regd_name = regd_str(TXPWR_LMT_WW);
RTW_PRINT("assign %s for default case\n", regd_str(TXPWR_LMT_WW));
Expand Down Expand Up @@ -1397,7 +1397,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
ptable->func = &OnAuth;
else
ptable->func = &OnAuthClient;
/* fall through */
__attribute__((__fallthrough__));
case WIFI_ASSOCREQ:
case WIFI_REASSOCREQ:
_mgt_dispatcher(padapter, ptable, precv_frame);
Expand Down
2 changes: 1 addition & 1 deletion hal/hal_halmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -3075,7 +3075,7 @@ static int _send_general_info(struct dvobj_priv *d)
case HALMAC_RET_NO_DLFW:
RTW_WARN("%s: halmac_send_general_info() fail because fw not dl!\n",
__FUNCTION__);
/* fall through */
__attribute__((__fallthrough__));
default:
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion hal/hal_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,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 */
/* fall through */
__attribute__((__fallthrough__));
default:
if (phydm_c2H_content_parsing(adapter_to_phydm(adapter), id, plen, payload) != TRUE)
ret = _FAIL;
Expand Down
4 changes: 2 additions & 2 deletions hal/halmac/halmac_88xx/halmac_mimo_88xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ cfg_txbf_88xx(struct halmac_adapter *adapter, u8 userid, enum halmac_bw bw,
switch (bw) {
case HALMAC_BW_80:
tmp42c |= BIT_R_TXBF0_80M;
/* fall through */
__attribute__((__fallthrough__));
case HALMAC_BW_40:
tmp42c |= BIT_R_TXBF0_40M;
/* fall through */
__attribute__((__fallthrough__));
case HALMAC_BW_20:
tmp42c |= BIT_R_TXBF0_20M;
break;
Expand Down
4 changes: 2 additions & 2 deletions hal/rtl8822b/rtl8822b_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1356,13 +1356,13 @@ static void _sounding_config_su(PADAPTER adapter, struct beamformee_entry *bfee,
new_ctrl |= BIT_R_TXBF0_80M_8822B;
else if (1 == bfee->su_reg_index)
new_ctrl |= BIT_R_TXBF1_80M_8822B;
/* fall through */
__attribute__((__fallthrough__));
case CHANNEL_WIDTH_40:
if (0 == bfee->su_reg_index)
new_ctrl |= BIT_R_TXBF0_40M_8822B;
else if (1 == bfee->su_reg_index)
new_ctrl |= BIT_R_TXBF1_40M_8822B;
/* fall through */
__attribute__((__fallthrough__));
case CHANNEL_WIDTH_20:
if (0 == bfee->su_reg_index)
new_ctrl |= BIT_R_TXBF0_20M_8822B;
Expand Down

0 comments on commit 6aa9651

Please sign in to comment.