lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <31aa626d-3d39-ca5f-c91d-47aa5bf7715b@quicinc.com>
Date:   Tue, 22 Feb 2022 17:19:01 -0800
From:   Jeff Johnson <quic_jjohnson@...cinc.com>
To:     Colin Ian King <colin.i.king@...il.com>,
        Toke Høiland-Jørgensen <toke@...e.dk>,
        Kalle Valo <kvalo@...nel.org>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        <linux-wireless@...r.kernel.org>, <netdev@...r.kernel.org>
CC:     <kernel-janitors@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ath9k: make array voice_priority static const

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@...il.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@...cinc.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ