xref: /netbsd-src/sys/external/bsd/common/include/linux/bug.h (revision 202732a5420aff385bd8580fc6bf03e55f94eb6a)
1*202732a5Sriastradh /*	$NetBSD: bug.h,v 1.1 2021/12/19 10:55:15 riastradh Exp $	*/
2*202732a5Sriastradh 
3*202732a5Sriastradh /*-
4*202732a5Sriastradh  * Copyright (c) 2013 The NetBSD Foundation, Inc.
5*202732a5Sriastradh  * All rights reserved.
6*202732a5Sriastradh  *
7*202732a5Sriastradh  * This code is derived from software contributed to The NetBSD Foundation
8*202732a5Sriastradh  * by Taylor R. Campbell.
9*202732a5Sriastradh  *
10*202732a5Sriastradh  * Redistribution and use in source and binary forms, with or without
11*202732a5Sriastradh  * modification, are permitted provided that the following conditions
12*202732a5Sriastradh  * are met:
13*202732a5Sriastradh  * 1. Redistributions of source code must retain the above copyright
14*202732a5Sriastradh  *    notice, this list of conditions and the following disclaimer.
15*202732a5Sriastradh  * 2. Redistributions in binary form must reproduce the above copyright
16*202732a5Sriastradh  *    notice, this list of conditions and the following disclaimer in the
17*202732a5Sriastradh  *    documentation and/or other materials provided with the distribution.
18*202732a5Sriastradh  *
19*202732a5Sriastradh  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20*202732a5Sriastradh  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21*202732a5Sriastradh  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22*202732a5Sriastradh  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23*202732a5Sriastradh  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24*202732a5Sriastradh  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25*202732a5Sriastradh  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26*202732a5Sriastradh  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27*202732a5Sriastradh  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28*202732a5Sriastradh  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29*202732a5Sriastradh  * POSSIBILITY OF SUCH DAMAGE.
30*202732a5Sriastradh  */
31*202732a5Sriastradh 
32*202732a5Sriastradh #ifndef _LINUX_BUG_H_
33*202732a5Sriastradh #define _LINUX_BUG_H_
34*202732a5Sriastradh 
35*202732a5Sriastradh #include <asm/bug.h>
36*202732a5Sriastradh 
37*202732a5Sriastradh #define	BUILD_BUG_ON_NOT_POWER_OF_2(n)					      \
38*202732a5Sriastradh 	CTASSERT(((n) != 0) && (((n) & ((n) - 1)) == 0))
39*202732a5Sriastradh 
40*202732a5Sriastradh #endif  /* _LINUX_BUG_H_ */
41