ATH11K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: ath11k@lists.infradead.org
Subject: [PATCH 5/5] ath11k: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
Date: Mon, 17 Jun 2019 19:32:59 +0300	[thread overview]
Message-ID: <1560789179-3857-5-git-send-email-kvalo@codeaurora.org> (raw)
In-Reply-To: <1560789179-3857-1-git-send-email-kvalo@codeaurora.org>

Fix 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]

Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/debug.c | 2 +-
 drivers/net/wireless/ath/ath11k/dp_tx.c | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/debug.c b/drivers/net/wireless/ath/ath11k/debug.c
index 97ecde81559c..95bf80d38ea7 100644
--- a/drivers/net/wireless/ath/ath11k/debug.c
+++ b/drivers/net/wireless/ath/ath11k/debug.c
@@ -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;
 	}
diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c
index 75d5629c3979..202dba40ba4f 100644
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
@@ -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);
-- 
2.7.4


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

  parent reply	other threads:[~2019-06-17 16:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 16:32 [PATCH 1/5] ath11k: 'static' is not at beginning of declaration [-Wold-style-declaration] Kalle Valo
2019-06-17 16:32 ` [PATCH 2/5] ath11k: this statement may fall through [-Wimplicit-fallthrough=] Kalle Valo
2019-06-17 16:32 ` [PATCH 3/5] ath11k: variable set but not used [-Wunused-but-set-variable] Kalle Valo
2019-06-17 16:32 ` [PATCH 4/5] ath11k: comparison is always true due to limited range of data type [-Wtype-limits] Kalle Valo
2019-06-17 16:32 ` Kalle Valo [this message]
2019-06-18 12:26 ` [PATCH 1/5] ath11k: 'static' is not at beginning of declaration [-Wold-style-declaration] Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1560789179-3857-5-git-send-email-kvalo@codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox