From cbc9bc3e76ceef6e3f3645b6c1933699d57f0598 Mon Sep 17 00:00:00 2001 From: bluhm Date: Sun, 16 Apr 2017 17:16:21 +0000 Subject: [PATCH] Always evaluate expression in BUG_ON() macro to avoid unused variable warnings. Makes non diagnostic kernel compile. OK kettenis@ --- sys/dev/pci/drm/drm_linux.h | 8 ++++++-- 1 file 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) -- 2.20.1