ath11k: 'static' is not at beginning of declaration [-Wold-style-declaration]
PATCH 1/5 ath11k: 'static' is not at beginning of declaration [-Wold-style-declaration]
Fix gcc W=1 warnings:
drivers/net/wireless/ath/ath11k/mac.c:5375:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration] drivers/net/wireless/ath/ath11k/mac.c:5380:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration] drivers/net/wireless/ath/ath11k/mac.c:5386:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration] drivers/net/wireless/ath/ath11k/mac.c:5392:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]
--- drivers/net/wireless/ath/ath11k/mac.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +4 -4
@@ -5372,24 +5372,24 @@ static int ath11k_mac_setup_channels_rates(struct ath11k *ar,return 0 ; } -const static u8 ath11k_if_types_ext_capa[] = { +static const u8 ath11k_if_types_ext_capa[] = { [0 ] =WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING , [7 ] =WLAN_EXT_CAPA8_OPMODE_NOTIF , }; -const static u8 ath11k_if_types_ext_capa_sta[] = { +static const u8 ath11k_if_types_ext_capa_sta[] = { [0 ] =WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING , [7 ] =WLAN_EXT_CAPA8_OPMODE_NOTIF , [9 ] =WLAN_EXT_CAPA10_TWT_REQUESTER_SUPPORT , }; -const static u8 ath11k_if_types_ext_capa_ap[] = { +static const u8 ath11k_if_types_ext_capa_ap[] = { [0 ] =WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING , [7 ] =WLAN_EXT_CAPA8_OPMODE_NOTIF , [9 ] =WLAN_EXT_CAPA10_TWT_RESPONDER_SUPPORT , }; -const static struct wiphy_iftype_ext_capab ath11k_iftypes_ext_capa[] = { +static const struct wiphy_iftype_ext_capab ath11k_iftypes_ext_capa[] = { { .extended_capabilities = ath11k_if_types_ext_capa, .extended_capabilities_mask = ath11k_if_types_ext_capa,
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 2/5 ath11k: this statement may fall through [-Wimplicit-fallthrough=]
With W=1 GCC warns:
drivers/net/wireless/ath/ath11k/core.c:757:14: warning: this statement may fall through [-Wimplicit-fallthrough=] vers/net/wireless/ath/ath11k/mac.c:1332:25: warning: this statement may fall through [-Wimplicit-fallthrough=] drivers/net/wireless/ath/ath11k/dp.c:133:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
--- drivers/net/wireless/ath/ath11k/core.c | 1 + drivers/net/wireless/ath/ath11k/dp.c | 1 + drivers/net/wireless/ath/ath11k/mac.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/core.c +1 -0
@@ -755,6 +755,7 @@ static void ath11k_core_restart(struct work_struct *work)break ;case ATH11K_STATE_RESTARTED : ar->state =ATH11K_STATE_WEDGED ; +/* fall through */ case ATH11K_STATE_WEDGED :ath11k_warn (sc,"device is wedged, will not restart radio %d\n" , i);
drivers/net/wireless/ath/ath11k/dp.c +1 -0
@@ -138,6 +138,7 @@ int ath11k_dp_srng_setup(struct ath11k_base *ab, struct dp_srng *ring,break ; }/* follow through when ring_num >= 3 */ +/* fall through */ case HAL_REO_EXCEPTION :case HAL_REO_REINJECT :case HAL_REO_CMD :
drivers/net/wireless/ath/ath11k/mac.c +1 -1
@@ -1330,7 +1330,7 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar, arg->peer_he_tx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_160 ] = v; arg->peer_he_mcs_count++; -/* drop through */ +/* fall through */ default : v =le16_to_cpu (he_cap->he_mcs_nss_supp.rx_mcs_80);
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 3/5 ath11k: variable set but not used [-Wunused-but-set-variable]
In reply to Kalle ValoFix GCC W=1 warnings:
drivers/net/wireless/ath/ath11k/htc.c:204:6: warning: variable 'orig_length' set but not used [-Wunused-but-set-variable] drivers/net/wireless/ath/ath11k/htc.c:203:6: warning: variable 'orig_buffer' set but not used [-Wunused-but-set-variable] drivers/net/wireless/ath/ath11k/htc.c:745:24: warning: variable 'ep' set but not used [-Wunused-but-set-variable] drivers/net/wireless/ath/ath11k/wmi.c:4422:9: warning: variable 'num_vdevs' set but not used [-Wunused-but-set-variable] drivers/net/wireless/ath/ath11k/dp_tx.c:448:5: warning: variable 'tcl_id' set but not used [-Wunused-but-set-variable] drivers/net/wireless/ath/ath11k/dp_rx.c:3675:6: warning: variable 'data' set but not used [-Wunused-but-set-variable] drivers/net/wireless/ath/ath11k/dp_rx.c:4070:6: warning: variable 'rx_tlv_start' set but not used [-Wunused-but-set-variable]
--- drivers/net/wireless/ath/ath11k/dp_rx.c | 5 +---- drivers/net/wireless/ath/ath11k/dp_tx.c | 4 ---- drivers/net/wireless/ath/ath11k/htc.c | 8 -------- drivers/net/wireless/ath/ath11k/wmi.c | 3 --- 4 files changed, 1 insertion(+), 19 deletions(-)
drivers/net/wireless/ath/ath11k/dp_rx.c +1 -4
@@ -3672,7 +3672,6 @@ ath11k_dp_rx_mon_mpdu_pop(struct ath11k *ar,u32 rx_bufs_used =0 , i =0 ;u32 msdu_ppdu_id =0 , msdu_cnt =0 ;u32 total_len =0 , frag_len =0 ; -u8 *data =NULL ;bool is_frag, is_first_msdu;bool drop_mpdu = false;struct ath11k_skb_rxcb *rxcb;
@@ -3752,7 +3751,7 @@ ath11k_dp_rx_mon_mpdu_pop(struct ath11k *ar, msdu =NULL ; goto next_msdu; } - data = msdu->data; + rx_desc = msdu->data; rx_pkt_offset =sizeof (struct hal_rx_desc );
@@ -4067,7 +4066,6 @@ static void ath11k_dp_rx_mon_status_process_tlv(struct ath11k *ar,struct hal_rx_mon_ppdu_info *ppdu_info;struct sk_buff *status_skb;u8 *rx_tlv; -u8 *rx_tlv_start;u32 tlv_status =HAL_TLV_STATUS_BUF_DONE ;struct ath11k_pdev_mon_stats *rx_mon_stats;
@@ -4081,7 +4079,6 @@ static void ath11k_dp_rx_mon_status_process_tlv(struct ath11k *ar, status_skb =skb_dequeue (&pmon->rx_status_q); rx_tlv = status_skb->data; - rx_tlv_start = rx_tlv; tlv_status =ath11k_hal_rx_parse_mon_status (ar->ab, ppdu_info, rx_tlv);
drivers/net/wireless/ath/ath11k/dp_tx.c +0 -4
@@ -444,8 +444,6 @@ void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)struct dp_tx_ring *tx_ring = &dp->tx_ring[ring_id];u32 *desc;u32 msdu_id; -u8 pool_id; -u8 tcl_id;u8 mac_id;spin_lock_bh (&status_ring->lock);
@@ -477,9 +475,7 @@ void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)ath11k_hal_tx_status_parse (ab, &tx_status, &ts); mac_id =FIELD_GET (DP_TX_DESC_ID_MAC_ID , ts.desc_id); - pool_id =FIELD_GET (DP_TX_DESC_ID_POOL_ID , ts.desc_id); msdu_id =FIELD_GET (DP_TX_DESC_ID_MSDU_ID , ts.desc_id); - tcl_id = ath11k_txq_tcl_ring_map[pool_id];if (ts.buf_rel_source ==HAL_WBM_REL_SRC_MODULE_FW ) { ath11k_dp_tx_process_htt_tx_complete(ab,
drivers/net/wireless/ath/ath11k/htc.c +0 -8
@@ -200,13 +200,8 @@ static int ath11k_htc_process_trailer(struct ath11k_htc *htc,struct ath11k_base *ab = htc->ab;int status =0 ;struct ath11k_htc_record *record; -u8 *orig_buffer; -int orig_length;size_t len; - orig_buffer = buffer; - orig_length = length; -while (length >0 ) { record = (struct ath11k_htc_record *)buffer;
@@ -742,7 +737,6 @@ int ath11k_htc_start(struct ath11k_htc *htc)int ath11k_htc_init (struct ath11k_base *ab) { -struct ath11k_htc_ep *ep =NULL ;struct ath11k_htc *htc = &ab->htc;struct ath11k_htc_svc_conn_req conn_req;struct ath11k_htc_svc_conn_resp conn_resp;
@@ -754,8 +748,6 @@ int ath11k_htc_init(struct ath11k_base *ab) htc->ab = ab; - ep = &htc->endpoint[ATH11K_HTC_EP_0 ]; -switch (ab->wmi_sc.preferred_hw_mode) {case WMI_HOST_HW_MODE_SINGLE : htc->wmi_ep_count =1 ;
drivers/net/wireless/ath/ath11k/wmi.c +0 -3
@@ -4419,7 +4419,6 @@ void ath11k_wmi_fw_stats_fill(struct ath11k *ar,const struct ath11k_fw_stats_bcn *bcn;size_t num_peers;size_t num_peers_extd; -size_t num_vdevs;size_t num_bcn;spin_lock_bh (&ar->data_lock);
@@ -4438,8 +4437,6 @@ void ath11k_wmi_fw_stats_fill(struct ath11k *ar, }if (stats_id ==WMI_REQUEST_VDEV_STAT ) { - num_vdevs =ath11k_wmi_fw_stats_num_vdevs (&fw_stats->vdevs); - len +=scnprintf (buf + len, buf_len - len,"\n" ); len +=scnprintf (buf + len, buf_len - len,"%30s\n" ,"ath11k VDEV stats" );
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 4/5 ath11k: comparison is always true due to limited range of data type [-Wtype-limits]
In reply to Kalle Valodrivers/net/wireless/ath/ath11k/hal_rx.c:57:18: warning: comparison is always true due to limited range of data type [-Wtype-limits] drivers/net/wireless/ath/ath11k/dp_rx.c:2375:21: warning: comparison is always true due to limited range of data type [-Wtype-limits] drivers/net/wireless/ath/ath11k/dp_rx.c:2378:20: warning: comparison is always true due to limited range of data type [-Wtype-limits] drivers/net/wireless/ath/ath11k/dp_rx.c:2382:20: warning: comparison is always true due to limited range of data type [-Wtype-limits] drivers/net/wireless/ath/ath11k/dp_rx.c:2385:22: warning: comparison is always true due to limited range of data type [-Wtype-limits] drivers/net/wireless/ath/ath11k/dp_rx.c:2389:21: warning: comparison is always true due to limited range of data type [-Wtype-limits] drivers/net/wireless/ath/ath11k/dp_rx.c:2396:32: warning: comparison is always true due to limited range of data type [-Wtype-limits]
--- drivers/net/wireless/ath/ath11k/debug_htt_stats.c | 2 +- drivers/net/wireless/ath/ath11k/dp_rx.c | 18 +++++++----------- drivers/net/wireless/ath/ath11k/hal_rx.c | 6 +++--- 3 files changed, 11 insertions(+), 15 deletions(-)
drivers/net/wireless/ath/ath11k/debug_htt_stats.c +1 -1
@@ -52,7 +52,7 @@ static inline void htt_print_stats_string_tlv(const u32 *tag_buf, index +=snprintf (&data[index],HTT_MAX_STRING_LEN - index,"%.*s" ,4 , (char *)&(htt_stats_buf->data[i])); -if (index <0 || index >=HTT_MAX_STRING_LEN ) +if (index >=HTT_MAX_STRING_LEN )break ; }
drivers/net/wireless/ath/ath11k/dp_rx.c +7 -11
@@ -2372,29 +2372,25 @@ static void ath11k_dp_rx_update_peer_stats(struct ath11k_sta *arsta,if (ppdu_info->nss >0 && ppdu_info->nss <=HAL_RX_MAX_NSS ) rx_stats->nss_count[ppdu_info->nss -1 ] += num_msdu; -if (ppdu_info->mcs >=0 && ppdu_info->mcs <=HAL_RX_MAX_MCS ) +if (ppdu_info->mcs <=HAL_RX_MAX_MCS ) rx_stats->mcs_count[ppdu_info->mcs] += num_msdu; -if (ppdu_info->gi >=HAL_RX_GI_0_8_US && - ppdu_info->gi <HAL_RX_GI_MAX ) +if (ppdu_info->gi <HAL_RX_GI_MAX ) rx_stats->gi_count[ppdu_info->gi] += num_msdu; -if (ppdu_info->bw >=HAL_RX_BW_20MHZ && ppdu_info->bw <HAL_RX_BW_MAX ) +if (ppdu_info->bw <HAL_RX_BW_MAX ) rx_stats->bw_count[ppdu_info->bw] += num_msdu; -if (ppdu_info->ldpc >=HAL_RX_SU_MU_CODING_BCC && - ppdu_info->ldpc <HAL_RX_SU_MU_CODING_MAX ) +if (ppdu_info->ldpc <HAL_RX_SU_MU_CODING_MAX ) rx_stats->coding_count[ppdu_info->ldpc] += num_msdu; -if (ppdu_info->tid >=0 && ppdu_info->tid <=IEEE80211_NUM_TIDS ) +if (ppdu_info->tid <=IEEE80211_NUM_TIDS ) rx_stats->tid_count[ppdu_info->tid] += num_msdu; -if (ppdu_info->preamble_type >=HAL_RX_PREAMBLE_11A && - ppdu_info->preamble_type <HAL_RX_PREAMBLE_MAX ) +if (ppdu_info->preamble_type <HAL_RX_PREAMBLE_MAX ) rx_stats->pream_cnt[ppdu_info->preamble_type] += num_msdu; -if (ppdu_info->reception_type >=HAL_RX_RECEPTION_TYPE_SU && - ppdu_info->reception_type <HAL_RX_RECEPTION_TYPE_MAX ) +if (ppdu_info->reception_type <HAL_RX_RECEPTION_TYPE_MAX ) rx_stats->reception_type[ppdu_info->reception_type] += num_msdu;if (ppdu_info->is_stbc)
drivers/net/wireless/ath/ath11k/hal_rx.c +3 -3
@@ -54,10 +54,10 @@ static int ath11k_hal_reo_cmd_flush_cache(struct ath11k_hal *hal, u32 *reo_desc,u8 avail_slot =ffz (hal->avail_blk_resource);if (cmd->flag &HAL_REO_CMD_FLG_FLUSH_BLOCK_LATER ) { -if (avail_slot >=0 && avail_slot <HAL_MAX_AVAIL_BLK_RES ) - hal->current_blk_index = avail_slot; -else +if (avail_slot >=HAL_MAX_AVAIL_BLK_RES )return -ENOSPC ; + + hal->current_blk_index = avail_slot; } tlv->tl = FIELD_PREP(HAL_TLV_HDR_TAG, HAL_REO_FLUSH_CACHE) |
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 5/5 ath11k: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
In reply to Kalle ValoFix gcc W=1 warnings:
drivers/net/wireless/ath/ath11k/dp_tx.c:654:20: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] drivers/net/wireless/ath/ath11k/debug.c:808:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
--- drivers/net/wireless/ath/ath11k/debug.c | 2 +- drivers/net/wireless/ath/ath11k/dp_tx.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath11k/debug.c +1 -1
@@ -805,7 +805,7 @@ static ssize_t ath11k_write_extd_rx_stats(struct file *file, goto exit; } -if (enable <0 || enable >1 ) { +if (enable >1 ) { ret = -EINVAL ; goto exit; }
drivers/net/wireless/ath/ath11k/dp_tx.c +4 -2
@@ -650,10 +650,12 @@ int ath11k_dp_tx_htt_srng_setup(struct ath11k_base *ab, u32 ring_id, cmd->ring_base_addr_hi = (u64 )params.ring_base_paddr >>HAL_ADDR_MSB_REG_SHIFT ; - ring_entry_sz =ath11k_hal_srng_get_entrysize (ring_type); -if (ring_entry_sz <0 ) + ret =ath11k_hal_srng_get_entrysize (ring_type); +if (ret <0 )return -EINVAL ; + ring_entry_sz = ret; + ring_entry_sz >>=2 ; cmd->info1 =FIELD_PREP (HTT_SRNG_SETUP_CMD_INFO1_RING_ENTRY_SIZE , ring_entry_sz);
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Quoted 8 lines · Kalle Valo
Fix gcc W=1 warnings:
drivers/net/wireless/ath/ath11k/mac.c:5375:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]drivers/net/wireless/ath/ath11k/mac.c:5380:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]drivers/net/wireless/ath/ath11k/mac.c:5386:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]drivers/net/wireless/ath/ath11k/mac.c:5392:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]Signed-off-by Kalle Valo <[email protected]>
5 patches applied to ath11k-bringup branch of ath.git, thanks.
0ef38ce491f8 ath11k: 'static' is not at beginning of declaration [-Wold-style-declaration] 1e854321455c ath11k: this statement may fall through [-Wimplicit-fallthrough=] 022ffde5c6a1 ath11k: variable set but not used [-Wunused-but-set-variable] f39b098aac7e ath11k: comparison is always true due to limited range of data type [-Wtype-limits] 34276bb47f8d ath11k: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
Signature · 9 lines
https://patchwork.kernel.org/patch/10999767/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k