Source-Changes-HG archive

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

[src/trunk]: src/sys/sys do {...} while (0) to make DTRACE_PROBE macros prope...



details:   https://anonhg.NetBSD.org/src/rev/e3ec37e881b0
branches:  trunk
changeset: 1009269:e3ec37e881b0
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Apr 19 03:12:26 2020 +0000

description:
do {...} while (0) to make DTRACE_PROBE macros proper statements.

diffstat:

 sys/sys/sdt.h |  26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diffs (67 lines):

diff -r 18b827699ece -r e3ec37e881b0 sys/sys/sdt.h
--- a/sys/sys/sdt.h     Sun Apr 19 01:06:15 2020 +0000
+++ b/sys/sys/sdt.h     Sun Apr 19 03:12:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdt.h,v 1.12 2019/10/16 18:29:49 christos Exp $        */
+/*     $NetBSD: sdt.h,v 1.13 2020/04/19 03:12:26 riastradh Exp $       */
 
 /*-
  * Copyright 2006-2008 John Birrell <jb%FreeBSD.org@localhost>
@@ -37,45 +37,45 @@
 
 #define        _DTRACE_VERSION 1
 
-#define        DTRACE_PROBE(prov, name) {                              \
+#define        DTRACE_PROBE(prov, name) do {                           \
        extern void __dtrace_##prov##___##name(void);           \
        __dtrace_##prov##___##name();                           \
-}
+} while (0)
 
-#define        DTRACE_PROBE1(prov, name, arg1) {                       \
+#define        DTRACE_PROBE1(prov, name, arg1) do {                    \
        extern void __dtrace_##prov##___##name(unsigned long);  \
        __dtrace_##prov##___##name((unsigned long)arg1);        \
-}
+} while (0)
 
-#define        DTRACE_PROBE2(prov, name, arg1, arg2) {                 \
+#define        DTRACE_PROBE2(prov, name, arg1, arg2) do {              \
        extern void __dtrace_##prov##___##name(unsigned long,   \
            unsigned long);                                     \
        __dtrace_##prov##___##name((unsigned long)arg1,         \
            (unsigned long)arg2);                               \
-}
+} while (0)
 
-#define        DTRACE_PROBE3(prov, name, arg1, arg2, arg3) {           \
+#define        DTRACE_PROBE3(prov, name, arg1, arg2, arg3) do {        \
        extern void __dtrace_##prov##___##name(unsigned long,   \
            unsigned long, unsigned long);                      \
        __dtrace_##prov##___##name((unsigned long)arg1,         \
            (unsigned long)arg2, (unsigned long)arg3);          \
-}
+} while (0)
 
-#define        DTRACE_PROBE4(prov, name, arg1, arg2, arg3, arg4) {     \
+#define        DTRACE_PROBE4(prov, name, arg1, arg2, arg3, arg4) do {  \
        extern void __dtrace_##prov##___##name(unsigned long,   \
            unsigned long, unsigned long, unsigned long);       \
        __dtrace_##prov##___##name((unsigned long)arg1,         \
            (unsigned long)arg2, (unsigned long)arg3,           \
            (unsigned long)arg4);                               \
-}
+} while (0)
 
-#define        DTRACE_PROBE5(prov, name, arg1, arg2, arg3, arg4, arg5) {       \
+#define        DTRACE_PROBE5(prov, name, arg1, arg2, arg3, arg4, arg5) do {    \
        extern void __dtrace_##prov##___##name(unsigned long,           \
            unsigned long, unsigned long, unsigned long, unsigned long);\
        __dtrace_##prov##___##name((unsigned long)arg1,                 \
            (unsigned long)arg2, (unsigned long)arg3,                   \
            (unsigned long)arg4, (unsigned long)arg5);                  \
-}
+} while (0)
 
 #else /* _KERNEL */
 



Home | Main Index | Thread Index | Old Index