git: 0f64fc6a3486 - main - kern: Align the declaration of kernconfstring with its definition

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Thu, 22 Aug 2024 10:01:11 UTC
The branch main has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=0f64fc6a3486454ad708f517633f930e611fd6d2

commit 0f64fc6a3486454ad708f517633f930e611fd6d2
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2024-08-22 10:00:34 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2024-08-22 10:00:34 +0000

    kern: Align the declaration of kernconfstring with its definition
    
    It is defined as const char[] in config.c which is auto generated by
    usr.sbin/config/kernconf.tmpl .
    
    While here prefer macro SYSCTL_CONST_STRING to avoid casting.
    
    MFC after:      1 week
---
 sys/kern/kern_mib.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c
index fe6e49865682..0132478aa68a 100644
--- a/sys/kern/kern_mib.c
+++ b/sys/kern/kern_mib.c
@@ -464,10 +464,10 @@ SYSCTL_PROC(_kern, KERN_SECURELVL, securelevel,
 
 #ifdef INCLUDE_CONFIG_FILE
 /* Actual kernel configuration options. */
-extern char kernconfstring[];
+extern const char kernconfstring[];
 
-SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD,
-    kernconfstring, 0, "Kernel configuration file");
+SYSCTL_CONST_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD,
+    kernconfstring, "Kernel configuration file");
 #endif
 
 static int