git: 38ffc3f3194f - stable/13 - kern: Align the declaration of kernconfstring with its definition

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Mon, 02 Sep 2024 05:04:11 UTC
The branch stable/13 has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=38ffc3f3194f048bbfec9b2389b975ef359d896e

commit 38ffc3f3194f048bbfec9b2389b975ef359d896e
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2024-08-22 10:00:34 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2024-09-02 05:03:41 +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
    
    (cherry picked from commit 0f64fc6a3486454ad708f517633f930e611fd6d2)
    (cherry picked from commit d6271b6507b2404bd03f21f76a4e8394e083ae80)
---
 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 aa4798a5a956..b2e9e06f5793 100644
--- a/sys/kern/kern_mib.c
+++ b/sys/kern/kern_mib.c
@@ -451,10 +451,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