diff mbox series

[wireless,v2] wifi: ath10k: Fix an error code problem in ath10k_dbg_sta_write_peer_debug_trigger()

Message ID 20240422034243.938962-1-suhui@nfschina.com (mailing list archive)
State Accepted
Commit c511a9c12674d246916bb16c479d496b76983193
Delegated to: Kalle Valo
Headers show
Series [wireless,v2] wifi: ath10k: Fix an error code problem in ath10k_dbg_sta_write_peer_debug_trigger() | expand

Commit Message

Su Hui April 22, 2024, 3:42 a.m. UTC
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(-)

Comments

Kalle Valo April 22, 2024, 6:53 a.m. UTC | #1
Su Hui <suhui@nfschina.com> writes:

> 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;
> -	}

Minimal changes with one logical change per patch, please. I'll remove
this part in the pending branch.
Jeff Johnson April 22, 2024, 4:21 p.m. UTC | #2
On 4/21/2024 8:42 PM, Su Hui wrote:
> 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>Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Jeff Johnson April 22, 2024, 4:23 p.m. UTC | #3
On 4/21/2024 8:42 PM, Su Hui wrote:
> 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>

(try that again)
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Su Hui April 23, 2024, 1:21 a.m. UTC | #4
On 2024/4/22 14:53, Kalle Valo wrote:
> Su Hui <suhui@nfschina.com> writes:
>
>> 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;
>> -	}
> Minimal changes with one logical change per patch, please. I'll remove
> this part in the pending branch.
>
Sorry for this, thanks for your help!

Su Hui
Kalle Valo April 24, 2024, 3:40 p.m. UTC | #5
Su Hui <suhui@nfschina.com> wrote:

> Clang Static Checker (scan-build) warns:
> 
> 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.
> 
> Fixes: ee8b08a1be82 ("ath10k: add debugfs support to get per peer tids log via tracing")
> Signed-off-by: Su Hui <suhui@nfschina.com>
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

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

c511a9c12674 wifi: ath10k: Fix an error code problem in ath10k_dbg_sta_write_peer_debug_trigger()
diff mbox series

Patch

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 = {