Module Name:    src
Committed By:   pgoyette
Date:           Wed Oct  4 09:59:24 UTC 2017

Modified Files:
        src/sys/sys: kernhist.h

Log Message:
Use do {...} while 0; construct for KERNHIST_LINK_STATIC()

NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/sys/kernhist.h

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

Modified files:

Index: src/sys/sys/kernhist.h
diff -u src/sys/sys/kernhist.h:1.19 src/sys/sys/kernhist.h:1.20
--- src/sys/sys/kernhist.h:1.19	Wed Oct  4 09:10:37 2017
+++ src/sys/sys/kernhist.h	Wed Oct  4 09:59:24 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kernhist.h,v 1.19 2017/10/04 09:10:37 skrll Exp $	*/
+/*	$NetBSD: kernhist.h,v 1.20 2017/10/04 09:59:24 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -148,8 +148,10 @@ extern	struct kern_history_head kern_his
 #define KERNHIST_DEFINE(NAME) struct kern_history NAME
 
 #define KERNHIST_LINK_STATIC(NAME) \
+do { \
 	LIST_INSERT_HEAD(&kern_histories, &(NAME), list); \
-	sysctl_kernhist_new(&(NAME));
+	sysctl_kernhist_new(&(NAME)); \
+} while (/*CONSTCOND*/ 0)
 
 #define KERNHIST_INIT(NAME,N) \
 do { \
@@ -160,7 +162,7 @@ do { \
 	(NAME).e = (struct kern_history_ent *) \
 		kmem_zalloc(sizeof(struct kern_history_ent) * (N), KM_SLEEP); \
 	(NAME).s = 0; \
-	KERNHIST_LINK_STATIC(NAME) \
+	KERNHIST_LINK_STATIC(NAME); \
 } while (/*CONSTCOND*/ 0)
 
 #define KERNHIST_INITIALIZER(NAME,BUF) \
@@ -183,7 +185,7 @@ do { \
 	(NAME).e = (struct kern_history_ent *) (BUF); \
 	(NAME).s = 0; \
 	memset((NAME).e, 0, sizeof(struct kern_history_ent) * (NAME).n); \
-	KERNHIST_LINK_STATIC(NAME) \
+	KERNHIST_LINK_STATIC(NAME); \
 } while (/*CONSTCOND*/ 0)
 
 #ifndef KERNHIST_DELAY

Reply via email to