All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath9k: Make arrays prof_prio and channelmap static const
@ 2022-10-05 15:55 Colin Ian King
  2022-10-06 18:12 ` Toke Høiland-Jørgensen
  2022-10-10  9:46 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Colin Ian King @ 2022-10-05 15:55 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen, Kalle Valo, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-wireless,
	netdev
  Cc: kernel-janitors, linux-kernel

Don't populate the read-only arrays prof_prio and channelmap
on the stack but instead make them 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 | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/mci.c b/drivers/net/wireless/ath/ath9k/mci.c
index 039bf0c35fbe..3363fc4e8966 100644
--- a/drivers/net/wireless/ath/ath9k/mci.c
+++ b/drivers/net/wireless/ath/ath9k/mci.c
@@ -266,7 +266,9 @@ static void ath_mci_set_concur_txprio(struct ath_softc *sc)
 			stomp_txprio[ATH_BTCOEX_STOMP_NONE] =
 				ATH_MCI_INQUIRY_PRIO;
 	} else {
-		u8 prof_prio[] = { 50, 90, 94, 52 };/* RFCOMM, A2DP, HID, PAN */
+		static const u8 prof_prio[] = {
+			50, 90, 94, 52
+		}; /* RFCOMM, A2DP, HID, PAN */
 
 		stomp_txprio[ATH_BTCOEX_STOMP_LOW] =
 		stomp_txprio[ATH_BTCOEX_STOMP_NONE] = 0xff;
@@ -644,7 +646,9 @@ void ath9k_mci_update_wlan_channels(struct ath_softc *sc, bool allow_all)
 	struct ath_hw *ah = sc->sc_ah;
 	struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
 	struct ath9k_channel *chan = ah->curchan;
-	u32 channelmap[] = {0x00000000, 0xffff0000, 0xffffffff, 0x7fffffff};
+	static const u32 channelmap[] = {
+		0x00000000, 0xffff0000, 0xffffffff, 0x7fffffff
+	};
 	int i;
 	s16 chan_start, chan_end;
 	u16 wlan_chan;
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ath9k: Make arrays prof_prio and channelmap static const
  2022-10-05 15:55 [PATCH] ath9k: Make arrays prof_prio and channelmap static const Colin Ian King
@ 2022-10-06 18:12 ` Toke Høiland-Jørgensen
  2022-10-10  9:46 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Toke Høiland-Jørgensen @ 2022-10-06 18:12 UTC (permalink / raw)
  To: Colin Ian King, Kalle Valo, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel

Colin Ian King <colin.i.king@gmail.com> writes:

> Don't populate the read-only arrays prof_prio and channelmap
> on the stack but instead make them static const. Also makes the
> object code a little smaller.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ath9k: Make arrays prof_prio and channelmap static const
  2022-10-05 15:55 [PATCH] ath9k: Make arrays prof_prio and channelmap static const Colin Ian King
  2022-10-06 18:12 ` Toke Høiland-Jørgensen
@ 2022-10-10  9:46 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2022-10-10  9:46 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Toke Høiland-Jørgensen, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-wireless, netdev,
	kernel-janitors, linux-kernel

Colin Ian King <colin.i.king@gmail.com> wrote:

> Don't populate the read-only arrays prof_prio and channelmap
> on the stack but instead make them static const. Also makes the
> object code a little smaller.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

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

e161d4b60ae3 wifi: ath9k: Make arrays prof_prio and channelmap static const

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20221005155558.320556-1-colin.i.king@gmail.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-10  9:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-05 15:55 [PATCH] ath9k: Make arrays prof_prio and channelmap static const Colin Ian King
2022-10-06 18:12 ` Toke Høiland-Jørgensen
2022-10-10  9:46 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.