diff mbox

ath10k: remove redundant check of len with buf_len

Message ID 20170315163641.17052-1-colin.king@canonical.com (mailing list archive)
State Accepted
Commit eed4721fb6172b3051a8341f9089b728681a9454
Delegated to: Kalle Valo
Headers show

Commit Message

Colin King March 15, 2017, 4:36 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The check of len > buf_len is redundant as len is initialized
to 0 and buf_len to 4096, so this comparison is always false.
Remove it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/ath/ath10k/debug.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Kalle Valo March 20, 2017, 3:25 p.m. UTC | #1
Colin Ian King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The check of len > buf_len is redundant as len is initialized
> to 0 and buf_len to 4096, so this comparison is always false.
> Remove it.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Patch applied to ath-next branch of ath.git, thanks.

eed4721fb617 ath10k: remove redundant check of len with buf_len
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index fb0ade3..b499a09 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -249,9 +249,6 @@  static ssize_t ath10k_read_wmi_services(struct file *file,
 
 	mutex_lock(&ar->conf_mutex);
 
-	if (len > buf_len)
-		len = buf_len;
-
 	spin_lock_bh(&ar->data_lock);
 	for (i = 0; i < WMI_SERVICE_MAX; i++) {
 		enabled = test_bit(i, ar->wmi.svc_map);