Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci fix xmm7360_os_msleep() macro to actually work w...



details:   https://anonhg.NetBSD.org/src/rev/f7a60cae7927
branches:  trunk
changeset: 936545:f7a60cae7927
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Wed Jul 29 13:03:36 2020 +0000

description:
fix xmm7360_os_msleep() macro to actually work when not wrapped inside a block

from genua

diffstat:

 sys/dev/pci/xmm7360.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (27 lines):

diff -r e0b1b77a6fdf -r f7a60cae7927 sys/dev/pci/xmm7360.c
--- a/sys/dev/pci/xmm7360.c     Wed Jul 29 13:01:19 2020 +0000
+++ b/sys/dev/pci/xmm7360.c     Wed Jul 29 13:03:36 2020 +0000
@@ -74,7 +74,7 @@
 #include "opt_gateway.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xmm7360.c,v 1.5 2020/07/29 13:01:19 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xmm7360.c,v 1.6 2020/07/29 13:03:36 jdolecek Exp $");
 #endif
 
 #include <sys/param.h>
@@ -286,9 +286,11 @@
                return -error;                          \
        __ret;                                          \
 })
-#define xmm7360_os_msleep(msec)                                \
-               KASSERT(!cold);                         \
-               tsleep(xmm, 0, "wwancsl", msec * hz / 1000)
+#define xmm7360_os_msleep(msec)                                        \
+       do {                                                    \
+               KASSERT(!cold);                                 \
+               tsleep(xmm, 0, "wwancsl", msec * hz / 1000);    \
+       } while (0)
 
 static void *dma_alloc_coherent(struct device *, size_t, dma_addr_t *, int);
 static void dma_free_coherent(struct device *, size_t, volatile void *, dma_addr_t);



Home | Main Index | Thread Index | Old Index