Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [PATCH wireless v2] wifi: ath10k: Fix an error code problem in ath10k_dbg_sta_write_peer_debug_trigger()
@ 2024-04-22  3:42 Su Hui
  2024-04-22  6:53 ` Kalle Valo
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Su Hui @ 2024-04-22  3:42 UTC (permalink / raw)
  To: quic_jjohnson, kvalo, jjohnson, nathan, ndesaulniers, morbo,
	justinstitt
  Cc: Su Hui, c_mkenna, linux-wireless, ath10k, linux-kernel, llvm,
	kernel-janitors

Clang Static Checker (scan-build) Warning:
drivers/net/wireless/ath/ath10k/debugfs_sta.c:line 429, column 3
Value stored to 'ret' is never read.

Return 'ret' rather than 'count' when 'ret' stores an error code.
By the way, remove some useless code.

Fixes: ee8b08a1be82 ("ath10k: add debugfs support to get per peer tids log via tracing")
Signed-off-by: Su Hui <suhui@nfschina.com>
---
v2:
 - remove the initializer change.

 drivers/net/wireless/ath/ath10k/debugfs_sta.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/debugfs_sta.c b/drivers/net/wireless/ath/ath10k/debugfs_sta.c
index 394bf3c32abf..c1198e9027ae 100644
--- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c
+++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c
@@ -432,14 +432,12 @@ ath10k_dbg_sta_write_peer_debug_trigger(struct file *file,
 
 	ret = ath10k_wmi_peer_set_param(ar, arsta->arvif->vdev_id, sta->addr,
 					ar->wmi.peer_param->debug, peer_debug_trigger);
-	if (ret) {
+	if (ret)
 		ath10k_warn(ar, "failed to set param to trigger peer tid logs for station ret: %d\n",
 			    ret);
-		goto out;
-	}
 out:
 	mutex_unlock(&ar->conf_mutex);
-	return count;
+	return ret ?: count;
 }
 
 static const struct file_operations fops_peer_debug_trigger = {
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-04-24 15:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-22  3:42 [PATCH wireless v2] wifi: ath10k: Fix an error code problem in ath10k_dbg_sta_write_peer_debug_trigger() Su Hui
2024-04-22  6:53 ` Kalle Valo
2024-04-23  1:21   ` Su Hui
2024-04-22 16:21 ` Jeff Johnson
2024-04-22 16:23 ` Jeff Johnson
2024-04-24 15:40 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox