Module Name:    src
Committed By:   riastradh
Date:           Sun Oct 27 12:12:53 UTC 2024

Modified Files:
        src/sys/dev/acpi: apei_hest.c

Log Message:
apei(4): Use __SIMPLELOCK_UNLOCKED to initialize __cpu_simple_lock_t.

Zero-initialization is wrong on some architectures.  While it happens
to work on x86 (and this is under ifdef x86), let's just do the right
thing to make it clearer.

Noticed while preparing for:

PR kern/58775: apei(4) spamming console


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/acpi/apei_hest.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/apei_hest.c
diff -u src/sys/dev/acpi/apei_hest.c:1.4 src/sys/dev/acpi/apei_hest.c:1.5
--- src/sys/dev/acpi/apei_hest.c:1.4	Sun Oct 27 12:12:39 2024
+++ src/sys/dev/acpi/apei_hest.c	Sun Oct 27 12:12:53 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: apei_hest.c,v 1.4 2024/10/27 12:12:39 riastradh Exp $	*/
+/*	$NetBSD: apei_hest.c,v 1.5 2024/10/27 12:12:53 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: apei_hest.c,v 1.4 2024/10/27 12:12:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apei_hest.c,v 1.5 2024/10/27 12:12:53 riastradh Exp $");
 
 #include <sys/types.h>
 
@@ -265,7 +265,7 @@ apei_hest_ghes_v2_poll(void *cookie)
  * confusion, let's try to have only one CPU process error
  * notifications at a time.
  */
-static __cpu_simple_lock_t apei_hest_nmi_lock;
+static __cpu_simple_lock_t apei_hest_nmi_lock = __SIMPLELOCK_UNLOCKED;
 
 /*
  * apei_hest_ghes_nmi(tf, cookie)

Reply via email to