From: Kalle Valo <kvalo@kernel.org>
To: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
Cc: <ath11k@lists.infradead.org>, <linux-wireless@vger.kernel.org>,
Govindaraj Saminathan <quic_gsaminat@quicinc.com>
Subject: Re: [PATCH v4 2/4] wifi: ath11k: optimize ath11k_tm_cmd_get_version
Date: Thu, 01 Jun 2023 13:28:35 +0300 [thread overview]
Message-ID: <878rd3jx2k.fsf@kernel.org> (raw)
In-Reply-To: <20230517135934.16408-3-quic_rajkbhag@quicinc.com> (Raj Kumar Bhagat's message of "Wed, 17 May 2023 19:29:32 +0530")
Raj Kumar Bhagat <quic_rajkbhag@quicinc.com> writes:
> From: Govindaraj Saminathan <quic_gsaminat@quicinc.com>
>
> Currently ath11k_tm_cmd_get_version() uses local variable ret.
> optimize ath11k_tm_cmd_get_version() to avoid local variable use.
>
> Tested-on : IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: Govindaraj Saminathan <quic_gsaminat@quicinc.com>
> Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
> ---
> drivers/net/wireless/ath/ath11k/testmode.c | 17 +++++------------
> 1 file changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath11k/testmode.c b/drivers/net/wireless/ath/ath11k/testmode.c
> index ebeca5eb6a67..f562f860ebf3 100644
> --- a/drivers/net/wireless/ath/ath11k/testmode.c
> +++ b/drivers/net/wireless/ath/ath11k/testmode.c
> @@ -24,7 +24,6 @@ static const struct nla_policy ath11k_tm_policy[ATH11K_TM_ATTR_MAX + 1] = {
> static int ath11k_tm_cmd_get_version(struct ath11k *ar, struct nlattr *tb[])
> {
> struct sk_buff *skb;
> - int ret;
>
> ath11k_dbg(ar->ab, ATH11K_DBG_TESTMODE,
> "testmode cmd get version_major %d version_minor %d\n",
> @@ -36,18 +35,12 @@ static int ath11k_tm_cmd_get_version(struct ath11k *ar, struct nlattr *tb[])
> if (!skb)
> return -ENOMEM;
>
> - ret = nla_put_u32(skb, ATH11K_TM_ATTR_VERSION_MAJOR,
> - ATH11K_TESTMODE_VERSION_MAJOR);
> - if (ret) {
> - kfree_skb(skb);
> - return ret;
> - }
> -
> - ret = nla_put_u32(skb, ATH11K_TM_ATTR_VERSION_MINOR,
> - ATH11K_TESTMODE_VERSION_MINOR);
> - if (ret) {
> + if (nla_put_u32(skb, ATH11K_TM_ATTR_VERSION_MAJOR,
> + ATH11K_TESTMODE_VERSION_MAJOR) ||
> + nla_put_u32(skb, ATH11K_TM_ATTR_VERSION_MINOR,
> + ATH11K_TESTMODE_VERSION_MINOR)) {
> kfree_skb(skb);
> - return ret;
> + return -ENOBUFS;
> }
When optimising something it's always good to provide numbers to show
the improvement. But I can't see how this really improves anything so I
dropped this patch 2.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2023-06-01 10:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-17 13:59 [PATCH v4 0/4] ath11k: factory test mode support Raj Kumar Bhagat
2023-05-17 13:59 ` [PATCH v4 1/4] wifi: ath11k: remove unused function ath11k_tm_event_wmi Raj Kumar Bhagat
2023-06-01 10:31 ` Kalle Valo
2023-05-17 13:59 ` [PATCH v4 2/4] wifi: ath11k: optimize ath11k_tm_cmd_get_version Raj Kumar Bhagat
2023-06-01 10:28 ` Kalle Valo [this message]
2023-05-17 13:59 ` [PATCH v4 3/4] wifi: ath11k: factory test mode support Raj Kumar Bhagat
2023-06-01 10:23 ` Kalle Valo
2023-05-17 13:59 ` [PATCH v4 4/4] wifi: ath11k: Allow ath11k to boot without caldata in ftm mode Raj Kumar Bhagat
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=878rd3jx2k.fsf@kernel.org \
--to=kvalo@kernel.org \
--cc=ath11k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_gsaminat@quicinc.com \
--cc=quic_rajkbhag@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 NNTP newsgroup(s).