Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Sep 2024 04:18:47 GMT
From:      Zhenlei Huang <zlei@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 9c3fc1da7b3c - stable/13 - mips: Make the variable machine const
Message-ID:  <202409210418.48L4IlYl010172@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=9c3fc1da7b3c9e34dfa48f4f4c4e41b16e7a72e7

commit 9c3fc1da7b3c9e34dfa48f4f4c4e41b16e7a72e7
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2024-09-21 04:17:05 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2024-09-21 04:17:05 +0000

    mips: Make the variable machine const
    
    Unbreaks mips build after MFCing commit [1]. While here prefer
    macro SYSCTL_CONST_STRING to avoid casting.
    
    This is a direct commit to stable/13.
    
    1. 356be1348dac kernel: Make some compile time constant variables const
---
 sys/mips/mips/machdep.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/mips/mips/machdep.c b/sys/mips/mips/machdep.c
index 877216c25b05..a520700a70a7 100644
--- a/sys/mips/mips/machdep.c
+++ b/sys/mips/mips/machdep.c
@@ -101,9 +101,9 @@
 
 #define	BOOTINFO_DEBUG	0
 
-char machine[] = "mips";
-SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD,
-    machine, 0, "Machine class");
+const char machine[] = "mips";
+SYSCTL_CONST_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD,
+    machine, "Machine class");
 
 char cpu_model[80];
 SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, "Machine model");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202409210418.48L4IlYl010172>