Subversion Repositories Kolibri OS

Rev

Rev 6936 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6936 Rev 7143
Line 79... Line 79...
79
#define __WARN_printf(arg...)	do { printk(arg); __WARN(); } while (0)
79
#define __WARN_printf(arg...)	do { printk(arg); __WARN(); } while (0)
80
#define __WARN_printf_taint(taint, arg...)				\
80
#define __WARN_printf_taint(taint, arg...)				\
81
	do { printk(arg); __WARN_TAINT(taint); } while (0)
81
	do { printk(arg); __WARN_TAINT(taint); } while (0)
82
#endif
82
#endif
Line -... Line 83...
-
 
83
 
-
 
84
/* used internally by panic.c */
-
 
85
struct warn_args;
-
 
86
 
-
 
87
void __warn(const char *file, int line, void *caller, unsigned taint,
-
 
88
	    struct pt_regs *regs, struct warn_args *args);
83
 
89
 
84
#ifndef WARN_ON
90
#ifndef WARN_ON
85
#define WARN_ON(condition) ({						\
91
#define WARN_ON(condition) ({						\
86
	int __ret_warn_on = !!(condition);				\
92
	int __ret_warn_on = !!(condition);				\
87
	if (unlikely(__ret_warn_on))					\
93
	if (unlikely(__ret_warn_on))					\
Line 108... Line 114...
108
 
114
 
109
#define WARN_ON_ONCE(condition)	({				\
115
#define WARN_ON_ONCE(condition)	({				\
110
	static bool __section(.data.unlikely) __warned;		\
116
	static bool __section(.data.unlikely) __warned;		\
111
	int __ret_warn_once = !!(condition);			\
117
	int __ret_warn_once = !!(condition);			\
112
								\
118
								\
113
	if (unlikely(__ret_warn_once))				\
-
 
114
		if (WARN_ON(!__warned)) 			\
119
	if (unlikely(__ret_warn_once && !__warned)) {		\
-
 
120
		__warned = true;				\
-
 
121
		WARN_ON(1);					\
115
			__warned = true;			\
122
	}							\
116
	unlikely(__ret_warn_once);				\
123
	unlikely(__ret_warn_once);				\
Line 117... Line 124...
117
})
124
})
118
 
125
 
119
#define WARN_ONCE(condition, format...)	({			\
126
#define WARN_ONCE(condition, format...)	({			\
120
	static bool __section(.data.unlikely) __warned;		\
127
	static bool __section(.data.unlikely) __warned;		\
121
	int __ret_warn_once = !!(condition);			\
128
	int __ret_warn_once = !!(condition);			\
122
								\
-
 
123
	if (unlikely(__ret_warn_once))				\
129
								\
-
 
130
	if (unlikely(__ret_warn_once && !__warned)) {		\
-
 
131
		__warned = true;				\
124
		if (WARN(!__warned, format)) 			\
132
		WARN(1, format);				\
125
			__warned = true;			\
133
	}							\
Line 126... Line 134...
126
	unlikely(__ret_warn_once);				\
134
	unlikely(__ret_warn_once);				\
127
})
135
})
128
 
136
 
129
#define WARN_TAINT_ONCE(condition, taint, format...)	({	\
137
#define WARN_TAINT_ONCE(condition, taint, format...)	({	\
130
	static bool __section(.data.unlikely) __warned;		\
138
	static bool __section(.data.unlikely) __warned;		\
131
	int __ret_warn_once = !!(condition);			\
-
 
132
								\
139
	int __ret_warn_once = !!(condition);			\
-
 
140
								\
-
 
141
	if (unlikely(__ret_warn_once && !__warned)) {		\
133
	if (unlikely(__ret_warn_once))				\
142
		__warned = true;				\
134
		if (WARN_TAINT(!__warned, taint, format))	\
143
		WARN_TAINT(1, taint, format);			\
Line 135... Line 144...
135
			__warned = true;			\
144
	}							\
136
	unlikely(__ret_warn_once);				\
145
	unlikely(__ret_warn_once);				\
137
})
146
})
138
 
147
 
Line 139... Line 148...
139
#else /* !CONFIG_BUG */
148
#else /* !CONFIG_BUG */
140
#ifndef HAVE_ARCH_BUG
149
#ifndef HAVE_ARCH_BUG
141
#define BUG() do {} while (1)
150
#define BUG() do {} while (1)
Line 142... Line 151...
142
#endif
151
#endif
143
 
152
 
144
#ifndef HAVE_ARCH_BUG_ON
153
#ifndef HAVE_ARCH_BUG_ON