[PATCH] ath10k: remove redundant check of len with buf_len

Subsystems: atheros ath generic utilities, qualcomm atheros ath10k wireless driver, the rest

STALE3421d

2 messages, 2 authors, 2017-03-20 · open the first message on its own page

[PATCH] ath10k: remove redundant check of len with buf_len

From: Colin King <hidden>
Date: 2017-03-15 16:36:57

From: Colin Ian King <redacted>

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 <redacted>
---
 drivers/net/wireless/ath/ath10k/debug.c | 3 ---
 1 file changed, 3 deletions(-)
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);
-- 
2.10.2

Re: ath10k: remove redundant check of len with buf_len

From: Kalle Valo <hidden>
Date: 2017-03-20 15:29:47

Colin Ian King [off-list ref] wrote:
From: Colin Ian King <redacted>

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 <redacted>
Patch applied to ath-next branch of ath.git, thanks.

eed4721fb617 ath10k: remove redundant check of len with buf_len

-- 
https://patchwork.kernel.org/patch/9626131/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help