@@ -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;
}
@@ -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)
@@ -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) |
drivers/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] Signed-off-by: Kalle Valo <kvalo@codeaurora.org> --- 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(-)