From: Su Hui <suhui@nfschina.com>
To: Jeff Johnson <quic_jjohnson@quicinc.com>,
kvalo@kernel.org, jjohnson@kernel.org, nathan@kernel.org,
ndesaulniers@google.com, morbo@google.com,
justinstitt@google.com
Cc: c_mkenna@qti.qualcomm.com, linux-wireless@vger.kernel.org,
ath10k@lists.infradead.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH wireless] wifi: ath10k: Fix an error code problem in ath10k_dbg_sta_write_peer_debug_trigger()
Date: Mon, 22 Apr 2024 11:32:43 +0800 [thread overview]
Message-ID: <6d311a40-05b9-3958-673d-e4c4d154ce4f@nfschina.com> (raw)
In-Reply-To: <a4c2cb8c-dd80-457f-82b5-2eb58a9b55b5@quicinc.com>
On 2024/4/19 23:09, Jeff Johnson wrote:
> On 4/17/2024 1:17 AM, Su Hui wrote:
>> u8 peer_debug_trigger;
>> - int ret;
>> + int ret = 0;
> this is unnecessary since this will be written in all paths that lead to the
> return that reads it
Yes, this is my fault. I will remove this in v2 patch.
>>
>> if (kstrtou8_from_user(user_buf, count, 0, &peer_debug_trigger))
>> return -EINVAL;
>> @@ -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 = {
> I'd suggest as an alternate solution that this function is a good candidate
> for the the cleanup.h functionality. By scoping the mutex_lock() you can
> simply return at each error location, and remove the explicit mutex_unlock().
like guard(mutex)(&ar->conf_mutex)?
Maybe I can send a separate patch for this, because there are more than
one candidates
for the cleanup.h functionality.
> But I'd accept this with the initializer change removed as well since I don't
> think ath10k has any cleanup.h usages yet.
I will send v2 patch soon , thanks for your reply!
Su Hui
prev parent reply other threads:[~2024-04-22 3:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-17 8:17 [PATCH wireless] wifi: ath10k: Fix an error code problem in ath10k_dbg_sta_write_peer_debug_trigger() Su Hui
2024-04-19 15:09 ` Jeff Johnson
2024-04-22 3:32 ` Su Hui [this message]
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=6d311a40-05b9-3958-673d-e4c4d154ce4f@nfschina.com \
--to=suhui@nfschina.com \
--cc=ath10k@lists.infradead.org \
--cc=c_mkenna@qti.qualcomm.com \
--cc=jjohnson@kernel.org \
--cc=justinstitt@google.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=quic_jjohnson@quicinc.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).