From: Jeff Johnson <quic_jjohnson@quicinc.com>
To: "Colin Ian King" <colin.i.king@gmail.com>,
"Toke Høiland-Jørgensen" <toke@toke.dk>,
"Kalle Valo" <kvalo@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
"Jakub Kicinski" <kuba@kernel.org>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Cc: <kernel-janitors@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ath9k: make array voice_priority static const
Date: Tue, 22 Feb 2022 17:19:01 -0800 [thread overview]
Message-ID: <31aa626d-3d39-ca5f-c91d-47aa5bf7715b@quicinc.com> (raw)
In-Reply-To: <20220222121749.87513-1-colin.i.king@gmail.com>
On 2/22/2022 4:17 AM, Colin Ian King wrote:
> Don't populate the read-only array voice_priority on the stack but
> instead make it static const. Also makes the object code a little
> smaller.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> drivers/net/wireless/ath/ath9k/mci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/mci.c b/drivers/net/wireless/ath/ath9k/mci.c
> index 39d46c203f6b..5e0ae7e6412f 100644
> --- a/drivers/net/wireless/ath/ath9k/mci.c
> +++ b/drivers/net/wireless/ath/ath9k/mci.c
> @@ -43,7 +43,7 @@ static bool ath_mci_add_profile(struct ath_common *common,
> struct ath_mci_profile_info *info)
> {
> struct ath_mci_profile_info *entry;
> - u8 voice_priority[] = { 110, 110, 110, 112, 110, 110, 114, 116, 118 };
> + static const u8 voice_priority[] = { 110, 110, 110, 112, 110, 110, 114, 116, 118 };
>
> if ((mci->num_sco == ATH_MCI_MAX_SCO_PROFILE) &&
> (info->type == MCI_GPM_COEX_PROFILE_VOICE))
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
An additional cleanup that could be performed in that function:
if (info->voice_type < sizeof(voice_priority))
replace sizeof() with ARRAY_SIZE() so that it works correctly if the
base type is ever changed from u8
next prev parent reply other threads:[~2022-02-23 1:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 12:17 Colin Ian King
2022-02-23 1:19 ` Jeff Johnson [this message]
2022-02-24 15:08 ` Dan Carpenter
2022-02-26 21:01 ` Toke Høiland-Jørgensen
2022-03-09 15:09 ` Kalle Valo
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=31aa626d-3d39-ca5f-c91d-47aa5bf7715b@quicinc.com \
--to=quic_jjohnson@quicinc.com \
--cc=colin.i.king@gmail.com \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=toke@toke.dk \
/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
all inboxes | Powered by JetHome®