xref: /openbmc/linux/arch/arc/include/asm/asserts.h (revision 11c416e3)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (C) 2020 Synopsys, Inc. (www.synopsys.com)
4  *
5  * Author: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
6  */
7 #ifndef __ASM_ARC_ASSERTS_H
8 #define __ASM_ARC_ASSERTS_H
9 
10 /* Helpers to sanitize config options. */
11 
12 void chk_opt_strict(char *opt_name, bool hw_exists, bool opt_ena);
13 void chk_opt_weak(char *opt_name, bool hw_exists, bool opt_ena);
14 
15 /*
16  * Check required config option:
17  *  - panic in case of OPT enabled but corresponding HW absent.
18  *  - warn in case of OPT disabled but corresponding HW exists.
19 */
20 #define CHK_OPT_STRICT(opt_name, hw_exists)				\
21 ({									\
22 	chk_opt_strict(#opt_name, hw_exists, IS_ENABLED(opt_name));	\
23 })
24 
25 /*
26  * Check optional config option:
27  *  - panic in case of OPT enabled but corresponding HW absent.
28 */
29 #define CHK_OPT_WEAK(opt_name, hw_exists)				\
30 ({									\
31 	chk_opt_weak(#opt_name, hw_exists, IS_ENABLED(opt_name));	\
32 })
33 
34 #endif /* __ASM_ARC_ASSERTS_H */
35