summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2017-04-16 17:16:22 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2017-04-16 17:16:22 +0000
commitf5eac3795378a2ce8e510a1ed945746a93628fcf (patch)
tree320f8d57a54803a8a092e3b21dc4ae37634198e6 /sys/dev/pci/drm
parent4f40223e92d7b5ddd1ef5887f25efa056afd4c50 (diff)
Always evaluate expression in BUG_ON() macro to avoid unused variable
warnings. Makes non diagnostic kernel compile. OK kettenis@
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r--sys/dev/pci/drm/drm_linux.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/drm_linux.h b/sys/dev/pci/drm/drm_linux.h
index a7a212751d1..61102431244 100644
--- a/sys/dev/pci/drm/drm_linux.h
+++ b/sys/dev/pci/drm/drm_linux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_linux.h,v 1.48 2016/10/08 05:52:06 guenther Exp $ */
+/* $OpenBSD: drm_linux.h,v 1.49 2017/04/16 17:16:21 bluhm Exp $ */
/*
* Copyright (c) 2013, 2014, 2015 Mark Kettenis
*
@@ -162,7 +162,11 @@ do { \
panic("BUG at %s:%d", __FILE__, __LINE__); \
} while (0)
-#define BUG_ON(x) KASSERT(!(x))
+#ifndef DIAGNOSTIC
+#define BUG_ON(x) ((void)(x))
+#else
+#define BUG_ON(x) KASSERT(!(x))
+#endif
#define BUILD_BUG_ON(x) CTASSERT(!(x))
#define BUILD_BUG_ON_NOT_POWER_OF_2(x)