git: 7266f5249848 - main - x86: Mark the CPU idle function table as const
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 02 Jun 2023 17:43:40 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=7266f5249848512b99d4dc78256af148f9df986e
commit 7266f5249848512b99d4dc78256af148f9df986e
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-06-02 17:22:32 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-06-02 17:43:15 +0000
x86: Mark the CPU idle function table as const
No functional change intended.
MFC after: 1 week
---
sys/x86/x86/cpu_machdep.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sys/x86/x86/cpu_machdep.c b/sys/x86/x86/cpu_machdep.c
index e2b997016ab1..ffaa3789272e 100644
--- a/sys/x86/x86/cpu_machdep.c
+++ b/sys/x86/x86/cpu_machdep.c
@@ -719,9 +719,9 @@ cpu_idle_wakeup(int cpu)
/*
* Ordered by speed/power consumption.
*/
-static struct {
+static const struct {
void *id_fn;
- char *id_name;
+ const char *id_name;
int id_cpuid2_flag;
} idle_tbl[] = {
{ .id_fn = cpu_idle_spin, .id_name = "spin" },
@@ -785,7 +785,8 @@ cpu_idle_selector(const char *new_idle_name)
static int
cpu_idle_sysctl(SYSCTL_HANDLER_ARGS)
{
- char buf[16], *p;
+ char buf[16];
+ const char *p;
int error, i;
p = "unknown";