From patchwork Mon Jun 17 16:32:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 10999773 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 09BF714E5 for ; Mon, 17 Jun 2019 16:33:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1F3F288A0 for ; Mon, 17 Jun 2019 16:33:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5431288B8; Mon, 17 Jun 2019 16:33:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 771AC288A0 for ; Mon, 17 Jun 2019 16:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hOo/uazdTWF4UVqgizJkkTlRRrVnl3nrdIUail4+rqg=; b=C6XApEuKpWEtaS ROzWBlletgwtFyEW3eU7hbVlb1vrcByNn6JebRbeP6iefRE03YzbD+6zyarUE/5Z9Ds1eKP8thhXb CEvXIWJGwonkLZ1XdE/JC+nGg7rzGwJRPrV3fe5EYT2q3CtM0cut+9fqgPPk6zuJgIwWAHJHoubZR WSkZMyF9D6F1lVP4WxLLFePhVO+KXst8qFanwNVFcTUEGeHYVCy9v6qU3jDxpXEQQGwKQrps/RmBE txIrDsT8U9gSpx4RQnSvzv1Ojwm8fSkHYR3mRVCyTbtrBo5e4U78DwbSKX2RjSfv0zmktpoOVRZ4m QPojLI4WCkSAF0US2k9g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hcuZF-0005t1-7f; Mon, 17 Jun 2019 16:33:13 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hcuZB-0005qm-UC for ath11k@lists.infradead.org; Mon, 17 Jun 2019 16:33:11 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5F9ED607DE; Mon, 17 Jun 2019 16:33:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1560789189; bh=NQr1Rc5ypLIYDH/9Y0xxmtMBZ6UevqddEfWEqmPn8tE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NoqGaBss+9qbe5z31buTxSj/7/bvNOSzqe+rERzcAJgK9CuLPcP9e/m8mEDedZ6sj VAhh1xrN00qAxfBL+O3Owzt4ViXr3MEvO/lwQkN+XHNHdbK/UcBfZnPMf/F549lT7H W/wzA0+LOQ/rP5BED24U/XNvVUHcBBDUeyMwbHSc= Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 49EF6607DE for ; Mon, 17 Jun 2019 16:33:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1560789188; bh=NQr1Rc5ypLIYDH/9Y0xxmtMBZ6UevqddEfWEqmPn8tE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TzrYaVMWVKPkHV9wRCWDhxrAw/DKJHajx1uj0oQw99Xd8ZKoMcb6QS+ncUfTTKupw 0Mv0MPvfVu7FFsKqLdzPXdVUc22CS2mp3PMqX2VdHwkp2y+RQg5g0koI+YT/KL9PZc RnJsLCyBQV8mP+XyuokysvcKWFaeeofAyneVDBxc= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 49EF6607DE Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: ath11k@lists.infradead.org Subject: [PATCH 4/5] ath11k: comparison is always true due to limited range of data type [-Wtype-limits] Date: Mon, 17 Jun 2019 19:32:58 +0300 Message-Id: <1560789179-3857-4-git-send-email-kvalo@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560789179-3857-1-git-send-email-kvalo@codeaurora.org> References: <1560789179-3857-1-git-send-email-kvalo@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190617_093310_017804_B62359EE X-CRM114-Status: GOOD ( 10.14 ) X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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(-) diff --git a/drivers/net/wireless/ath/ath11k/debug_htt_stats.c b/drivers/net/wireless/ath/ath11k/debug_htt_stats.c index 9558c6ada6d8..22d44a59be14 100644 --- a/drivers/net/wireless/ath/ath11k/debug_htt_stats.c +++ b/drivers/net/wireless/ath/ath11k/debug_htt_stats.c @@ -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; } diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index 0823f6761426..2c7a3585059a 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -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) diff --git a/drivers/net/wireless/ath/ath11k/hal_rx.c b/drivers/net/wireless/ath/ath11k/hal_rx.c index 0308089c88df..ca55855db2bc 100644 --- a/drivers/net/wireless/ath/ath11k/hal_rx.c +++ b/drivers/net/wireless/ath/ath11k/hal_rx.c @@ -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) |