riscv: Make sysctl tables const
PATCH v2 1/1 riscv: Make sysctl tables const
Since commit 7abc9b53bd51 ("sysctl: allow registration of const struct ctl_table"), the sysctl registration API allows for struct ctl_table to be in read-only memory. Move tagged_addr_sysctl_table and riscv_v_default_vstate_table to be declared at build time, instead of having to be dynamically allocated at boot time.
Cc Thomas Weißschuh <[email protected]>
Suggested-by Thomas Weißschuh <[email protected]>
Signed-off-by Ricardo B. Marliere <[email protected]>
---
Changes in v2:
- Better commit message
- Link to v1: https://lore.kernel.org/r/[email protected]
--- arch/riscv/kernel/process.c | 2 +- arch/riscv/kernel/vector.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/riscv/kernel/process.c +1 -1
@@ -364,7 +364,7 @@ static bool try_to_set_pmm(unsigned long value)* disable it for tasks that already opted in to the relaxed ABI. */ -static struct ctl_table tagged_addr_sysctl_table[] = { +static const struct ctl_table tagged_addr_sysctl_table[] = { { .procname ="tagged_addr_disabled" , .mode =0644 ,
arch/riscv/kernel/vector.c +1 -1
@@ -287,7 +287,7 @@ long riscv_v_vstate_ctrl_set_current(unsigned long arg) #ifdef CONFIG_SYSCTL -static struct ctl_table riscv_v_default_vstate_table[] = { +static const struct ctl_table riscv_v_default_vstate_table[] = { { .procname = "riscv_v_default_allow", .data = &riscv_v_implicit_uacc,
---
base-commit: fac04efc5c793dccbd07e2d59af9f90b7fc0dca4
change-id: 20241205-sysctl_const-riscv-ba93ddd07156
Best regards,
Signature · 1 line
Ricardo B. Marliere <[email protected]>