Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys Use do {...} while 0; construct for KERNHIST_LINK_ST...



details:   https://anonhg.NetBSD.org/src/rev/e366eb03b7f5
branches:  trunk
changeset: 826892:e366eb03b7f5
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Wed Oct 04 09:59:24 2017 +0000

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

NFCI

diffstat:

 sys/sys/kernhist.h |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 67c04ebd62a2 -r e366eb03b7f5 sys/sys/kernhist.h
--- a/sys/sys/kernhist.h        Wed Oct 04 09:44:09 2017 +0000
+++ b/sys/sys/kernhist.h        Wed Oct 04 09:59:24 2017 +0000
@@ -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 @@
 #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 @@
        (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 @@
        (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



Home | Main Index | Thread Index | Old Index