Skip to contentSkip to conversation

qlcnic: make read-only const array key static

PATCH Applied Colin Ian King 3 participants 3 messages Sep 10, 2024 – Sep 12, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 qlcnic: make read-only const array key static

Don't populate the const read-only array key on the stack at run time, instead make it static.

---

V2: re-order declarations for reverse christmas tree layout

---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +7 -5
index bcef8ab715bf..d7cdea8f604d 100644
@@ -2042,12 +2042,14 @@ int qlcnic_83xx_config_hw_lro(struct qlcnic_adapter *adapter, int mode)
 
 int qlcnic_83xx_config_rss(struct qlcnic_adapter *adapter, int enable)
 {
-	int err;
-	u32 word;
 	struct qlcnic_cmd_args cmd;
-	const u64 key[] = { 0xbeac01fa6a42b73bULL, 0x8030f20c77cb2da3ULL,
-			    0xae7b30b4d0ca2bcbULL, 0x43a38fb04167253dULL,
-			    0x255b0ec26d5a56daULL };
+	static const u64 key[] = {
+		0xbeac01fa6a42b73bULL, 0x8030f20c77cb2da3ULL,
+		0xae7b30b4d0ca2bcbULL, 0x43a38fb04167253dULL,
+		0x255b0ec26d5a56daULL
+	};
+	u32 word;
+	int err;
 
 	err = qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_CONFIGURE_RSS);
 	if (err)
Signature · 1 line
2.39.2
#2 lore raw
In reply to Colin Ian King
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Tue, 10 Sep 2024 13:06:35 +0100 you wrote:

Don't populate the const read-only array key on the stack at run time, instead make it static.

---

[...]

Here is the summary with links:
- [next,V2] qlcnic: make read-only const array key static

    https://git.kernel.org/netdev/net-next/c/af647fe240a9

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html