diff mbox series

riscv: Constify ctl_table variables

Message ID 20241205-sysctl_const-riscv-v1-1-04231ca9a78f@suse.com (mailing list archive)
State New
Headers show
Series riscv: Constify ctl_table variables | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR fail PR summary
conchuod/patch-1-test-1 fail .github/scripts/patches/tests/build_rv32_defconfig.sh took 181.43s
conchuod/patch-1-test-2 fail .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh took 1016.44s
conchuod/patch-1-test-3 fail .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh took 1697.95s
conchuod/patch-1-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh took 75.85s
conchuod/patch-1-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh took 77.37s
conchuod/patch-1-test-6 success .github/scripts/patches/tests/checkpatch.sh took 0.66s
conchuod/patch-1-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh took 46.71s
conchuod/patch-1-test-8 success .github/scripts/patches/tests/header_inline.sh took 0.00s
conchuod/patch-1-test-9 success .github/scripts/patches/tests/kdoc.sh took 0.51s
conchuod/patch-1-test-10 success .github/scripts/patches/tests/module_param.sh took 0.01s
conchuod/patch-1-test-11 success .github/scripts/patches/tests/verify_fixes.sh took 0.00s
conchuod/patch-1-test-12 success .github/scripts/patches/tests/verify_signedoff.sh took 0.03s

Commit Message

Ricardo B. Marliere Dec. 5, 2024, 3:31 p.m. UTC
Since 7abc9b53bd51 ("sysctl: allow registration of const struct
ctl_table"), it is possible to put ctl_table variables into read-only
storage. So, make tagged_addr_sysctl_table and riscv_v_default_vstate_table
const.

Cc: Thomas Weißschuh <linux@weissschuh.net>
Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Ricardo B. Marliere <rbm@suse.com>
---
 arch/riscv/kernel/process.c | 2 +-
 arch/riscv/kernel/vector.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


---
base-commit: 8d4f1e05ff821a5d59116ab8c3a30fcae81d8597
change-id: 20241205-sysctl_const-riscv-ba93ddd07156

Best regards,
diff mbox series

Patch

diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
index 58b6482c2bf662bf5224ca50c8e21a68760a6b41..7891294abf4937de3c7e440573844253e856b39f 100644
--- a/arch/riscv/kernel/process.c
+++ b/arch/riscv/kernel/process.c
@@ -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,
diff --git a/arch/riscv/kernel/vector.c b/arch/riscv/kernel/vector.c
index 821818886fab06aa054e2ba3266897e9b4d161c0..d022b028ac3ff5375f522947d34166266ceb424a 100644
--- a/arch/riscv/kernel/vector.c
+++ b/arch/riscv/kernel/vector.c
@@ -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,