* [PATCH v2] wifi: ath12k: Constify struct ath12k_dp_arch_ops
@ 2026-07-14 8:39 Christophe JAILLET
2026-07-15 2:03 ` Baochen Qiang
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Christophe JAILLET @ 2026-07-14 8:39 UTC (permalink / raw)
To: Jeff Johnson
Cc: linux-kernel, kernel-janitors, Christophe JAILLET,
linux-wireless, ath12k
'struct ath12k_dp_arch_ops' is not modified in this driver.
Constifying this structure moves some data to a read-only section, so
increases overall security, especially when the structure holds some
function pointers.
On a x86_64, with allmodconfig, as an example:
Before:
======
text data bss dec hex filename
6318 3384 0 9702 25e6 drivers/net/wireless/ath/ath12k/wifi7/dp.o
After:
=====
text data bss dec hex filename
6478 3224 0 9702 25e6 drivers/net/wireless/ath/ath12k/wifi7/dp.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Compile tested only.
Changes in v2:
- Add the missing const! [Ping-Ke Shih]
v1: https://lore.kernel.org/all/469d732e2c6f159e1a05e89c7e417c3a10db5fdf.1784010931.git.christophe.jaillet@wanadoo.fr/
---
drivers/net/wireless/ath/ath12k/dp.h | 2 +-
drivers/net/wireless/ath/ath12k/wifi7/dp.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/dp.h b/drivers/net/wireless/ath/ath12k/dp.h
index 64f79e43341e..a94bbc337df4 100644
--- a/drivers/net/wireless/ath/ath12k/dp.h
+++ b/drivers/net/wireless/ath/ath12k/dp.h
@@ -538,7 +538,7 @@ struct ath12k_dp {
/* Lock for protection of peers and rhead_peer_addr */
spinlock_t dp_lock;
- struct ath12k_dp_arch_ops *ops;
+ const struct ath12k_dp_arch_ops *ops;
/* Linked list of struct ath12k_dp_link_peer */
struct list_head peers;
diff --git a/drivers/net/wireless/ath/ath12k/wifi7/dp.c b/drivers/net/wireless/ath/ath12k/wifi7/dp.c
index c72f604661ce..01a45f428990 100644
--- a/drivers/net/wireless/ath/ath12k/wifi7/dp.c
+++ b/drivers/net/wireless/ath/ath12k/wifi7/dp.c
@@ -139,7 +139,7 @@ static int ath12k_wifi7_dp_service_srng(struct ath12k_dp *dp,
return tot_work_done;
}
-static struct ath12k_dp_arch_ops ath12k_wifi7_dp_arch_ops = {
+static const struct ath12k_dp_arch_ops ath12k_wifi7_dp_arch_ops = {
.service_srng = ath12k_wifi7_dp_service_srng,
.tx_get_vdev_bank_config = ath12k_wifi7_dp_tx_get_vdev_bank_config,
.reo_cmd_send = ath12k_wifi7_dp_reo_cmd_send,
--
2.55.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] wifi: ath12k: Constify struct ath12k_dp_arch_ops
2026-07-14 8:39 [PATCH v2] wifi: ath12k: Constify struct ath12k_dp_arch_ops Christophe JAILLET
@ 2026-07-15 2:03 ` Baochen Qiang
2026-07-16 17:22 ` Rameshkumar Sundaram
2026-07-17 15:06 ` Jeff Johnson
2 siblings, 0 replies; 4+ messages in thread
From: Baochen Qiang @ 2026-07-15 2:03 UTC (permalink / raw)
To: Christophe JAILLET, Jeff Johnson
Cc: linux-kernel, kernel-janitors, linux-wireless, ath12k
On 7/14/2026 4:39 PM, Christophe JAILLET wrote:
> 'struct ath12k_dp_arch_ops' is not modified in this driver.
>
> Constifying this structure moves some data to a read-only section, so
> increases overall security, especially when the structure holds some
> function pointers.
>
> On a x86_64, with allmodconfig, as an example:
> Before:
> ======
> text data bss dec hex filename
> 6318 3384 0 9702 25e6 drivers/net/wireless/ath/ath12k/wifi7/dp.o
>
> After:
> =====
> text data bss dec hex filename
> 6478 3224 0 9702 25e6 drivers/net/wireless/ath/ath12k/wifi7/dp.o
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] wifi: ath12k: Constify struct ath12k_dp_arch_ops
2026-07-14 8:39 [PATCH v2] wifi: ath12k: Constify struct ath12k_dp_arch_ops Christophe JAILLET
2026-07-15 2:03 ` Baochen Qiang
@ 2026-07-16 17:22 ` Rameshkumar Sundaram
2026-07-17 15:06 ` Jeff Johnson
2 siblings, 0 replies; 4+ messages in thread
From: Rameshkumar Sundaram @ 2026-07-16 17:22 UTC (permalink / raw)
To: Christophe JAILLET, Jeff Johnson
Cc: linux-kernel, kernel-janitors, linux-wireless, ath12k
On 7/14/2026 2:09 PM, Christophe JAILLET wrote:
> 'struct ath12k_dp_arch_ops' is not modified in this driver.
>
> Constifying this structure moves some data to a read-only section, so
> increases overall security, especially when the structure holds some
> function pointers.
>
> On a x86_64, with allmodconfig, as an example:
> Before:
> ======
> text data bss dec hex filename
> 6318 3384 0 9702 25e6 drivers/net/wireless/ath/ath12k/wifi7/dp.o
>
> After:
> =====
> text data bss dec hex filename
> 6478 3224 0 9702 25e6 drivers/net/wireless/ath/ath12k/wifi7/dp.o
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] wifi: ath12k: Constify struct ath12k_dp_arch_ops
2026-07-14 8:39 [PATCH v2] wifi: ath12k: Constify struct ath12k_dp_arch_ops Christophe JAILLET
2026-07-15 2:03 ` Baochen Qiang
2026-07-16 17:22 ` Rameshkumar Sundaram
@ 2026-07-17 15:06 ` Jeff Johnson
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Johnson @ 2026-07-17 15:06 UTC (permalink / raw)
To: Jeff Johnson, Christophe JAILLET
Cc: linux-kernel, kernel-janitors, linux-wireless, ath12k
On Tue, 14 Jul 2026 10:39:14 +0200, Christophe JAILLET wrote:
> 'struct ath12k_dp_arch_ops' is not modified in this driver.
>
> Constifying this structure moves some data to a read-only section, so
> increases overall security, especially when the structure holds some
> function pointers.
>
> On a x86_64, with allmodconfig, as an example:
> Before:
> ======
> text data bss dec hex filename
> 6318 3384 0 9702 25e6 drivers/net/wireless/ath/ath12k/wifi7/dp.o
>
> [...]
Applied, thanks!
[1/1] wifi: ath12k: Constify struct ath12k_dp_arch_ops
commit: ca435fd0650ac512ab6c5bdfeb90ed130b8f7574
Best regards,
--
Jeff Johnson <jeff.johnson@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-17 15:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-14 8:39 [PATCH v2] wifi: ath12k: Constify struct ath12k_dp_arch_ops Christophe JAILLET
2026-07-15 2:03 ` Baochen Qiang
2026-07-16 17:22 ` Rameshkumar Sundaram
2026-07-17 15:06 ` Jeff Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox