Mon Dec 25 09:13:40 2017 UTC ()
Apply C99-style struct initialization to lockops_t


(ozaki-r)
diff -r1.39 -r1.40 src/sys/kern/kern_condvar.c
diff -r1.160 -r1.161 src/sys/kern/kern_lock.c
diff -r1.67 -r1.68 src/sys/kern/kern_mutex.c
diff -r1.47 -r1.48 src/sys/kern/kern_rwlock.c
diff -r1.75 -r1.76 src/sys/rump/librump/rumpkern/locks.c

cvs diff -r1.39 -r1.40 src/sys/kern/kern_condvar.c (expand / switch to context diff)
--- src/sys/kern/kern_condvar.c 2017/11/12 20:04:51 1.39
+++ src/sys/kern/kern_condvar.c 2017/12/25 09:13:40 1.40
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_condvar.c,v 1.39 2017/11/12 20:04:51 riastradh Exp $	*/
+/*	$NetBSD: kern_condvar.c,v 1.40 2017/12/25 09:13:40 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_condvar.c,v 1.39 2017/11/12 20:04:51 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_condvar.c,v 1.40 2017/12/25 09:13:40 ozaki-r Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -79,9 +79,9 @@
 };
 
 lockops_t cv_lockops = {
-	"Condition variable",
-	LOCKOPS_CV,
-	NULL
+	.lo_name = "Condition variable",
+	.lo_type = LOCKOPS_CV,
+	.lo_dump = NULL,
 };
 
 static const char deadcv[] = "deadcv";

cvs diff -r1.160 -r1.161 src/sys/kern/kern_lock.c (expand / switch to context diff)
--- src/sys/kern/kern_lock.c 2017/11/21 08:49:14 1.160
+++ src/sys/kern/kern_lock.c 2017/12/25 09:13:40 1.161
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lock.c,v 1.160 2017/11/21 08:49:14 ozaki-r Exp $	*/
+/*	$NetBSD: kern_lock.c,v 1.161 2017/12/25 09:13:40 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.160 2017/11/21 08:49:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.161 2017/12/25 09:13:40 ozaki-r Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -120,9 +120,9 @@
 void	_kernel_lock_dump(const volatile void *);
 
 lockops_t _kernel_lock_ops = {
-	"Kernel lock",
-	LOCKOPS_SPIN,
-	_kernel_lock_dump
+	.lo_name = "Kernel lock",
+	.lo_type = LOCKOPS_SPIN,
+	.lo_dump = _kernel_lock_dump,
 };
 
 /*

cvs diff -r1.67 -r1.68 src/sys/kern/kern_mutex.c (expand / switch to context diff)
--- src/sys/kern/kern_mutex.c 2017/09/16 23:55:33 1.67
+++ src/sys/kern/kern_mutex.c 2017/12/25 09:13:40 1.68
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_mutex.c,v 1.67 2017/09/16 23:55:33 christos Exp $	*/
+/*	$NetBSD: kern_mutex.c,v 1.68 2017/12/25 09:13:40 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define	__MUTEX_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.67 2017/09/16 23:55:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.68 2017/12/25 09:13:40 ozaki-r Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -269,15 +269,15 @@
 static void	mutex_dump(const volatile void *);
 
 lockops_t mutex_spin_lockops = {
-	"Mutex",
-	LOCKOPS_SPIN,
-	mutex_dump
+	.lo_name = "Mutex",
+	.lo_type = LOCKOPS_SPIN,
+	.lo_dump = mutex_dump,
 };
 
 lockops_t mutex_adaptive_lockops = {
-	"Mutex",
-	LOCKOPS_SLEEP,
-	mutex_dump
+	.lo_name = "Mutex",
+	.lo_type = LOCKOPS_SLEEP,
+	.lo_dump = mutex_dump,
 };
 
 syncobj_t mutex_syncobj = {

cvs diff -r1.47 -r1.48 src/sys/kern/kern_rwlock.c (expand / switch to context diff)
--- src/sys/kern/kern_rwlock.c 2017/09/16 23:55:33 1.47
+++ src/sys/kern/kern_rwlock.c 2017/12/25 09:13:40 1.48
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rwlock.c,v 1.47 2017/09/16 23:55:33 christos Exp $	*/
+/*	$NetBSD: kern_rwlock.c,v 1.48 2017/12/25 09:13:40 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.47 2017/09/16 23:55:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.48 2017/12/25 09:13:40 ozaki-r Exp $");
 
 #define	__RWLOCK_PRIVATE
 
@@ -148,9 +148,9 @@
 #endif
 
 lockops_t rwlock_lockops = {
-	"Reader / writer lock",
-	LOCKOPS_SLEEP,
-	rw_dump
+	.lo_name = "Reader / writer lock",
+	.lo_type = LOCKOPS_SLEEP,
+	.lo_dump = rw_dump,
 };
 
 syncobj_t rw_syncobj = {

cvs diff -r1.75 -r1.76 src/sys/rump/librump/rumpkern/locks.c (expand / switch to context diff)
--- src/sys/rump/librump/rumpkern/locks.c 2017/09/17 05:47:19 1.75
+++ src/sys/rump/librump/rumpkern/locks.c 2017/12/25 09:13:40 1.76
@@ -1,4 +1,4 @@
-/*	$NetBSD: locks.c,v 1.75 2017/09/17 05:47:19 kre Exp $	*/
+/*	$NetBSD: locks.c,v 1.76 2017/12/25 09:13:40 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: locks.c,v 1.75 2017/09/17 05:47:19 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locks.c,v 1.76 2017/12/25 09:13:40 ozaki-r Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -51,14 +51,14 @@
 #include <sys/lockdebug.h>
 
 static lockops_t mutex_lockops = {
-	"mutex",
-	LOCKOPS_SLEEP,
-	NULL
+	.lo_name = "mutex",
+	.lo_type = LOCKOPS_SLEEP,
+	.lo_dump = NULL,
 };
 static lockops_t rw_lockops = {
-	"rwlock",
-	LOCKOPS_SLEEP,
-	NULL
+	.lo_name = "rwlock",
+	.lo_type = LOCKOPS_SLEEP,
+	.lo_dump = NULL,
 };
 
 #define ALLOCK(lock, ops)				\