Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/riastradh-drm2]: src/sys/external/bsd/drm2/include/linux Add WARN and WA...
details: https://anonhg.NetBSD.org/src/rev/f8d9a5168a9d
branches: riastradh-drm2
changeset: 788091:f8d9a5168a9d
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Jul 24 02:12:00 2013 +0000
description:
Add WARN and WARN_ON to <linux/kernel.h>.
diffstat:
sys/external/bsd/drm2/include/linux/kernel.h | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diffs (26 lines):
diff -r 32dc9277e9aa -r f8d9a5168a9d sys/external/bsd/drm2/include/linux/kernel.h
--- a/sys/external/bsd/drm2/include/linux/kernel.h Wed Jul 24 02:11:38 2013 +0000
+++ b/sys/external/bsd/drm2/include/linux/kernel.h Wed Jul 24 02:12:00 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kernel.h,v 1.1.2.5 2013/07/24 01:52:08 riastradh Exp $ */
+/* $NetBSD: kernel.h,v 1.1.2.6 2013/07/24 02:12:00 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -41,4 +41,16 @@
#define container_of(PTR, TYPE, FIELD) \
((TYPE *)(((char *)(PTR)) - offsetof(TYPE, FIELD)))
+#define ARRAY_SIZE(ARRAY) __arraycount(ARRAY)
+
+/* XXX Rate limit? */
+#define WARN(CONDITION, FMT, ...) do \
+{ \
+ if (CONDITION) \
+ printf("warning: %s:%d: " FMT, __FILE__, __LINE__, \
+ ##__VA_ARGS__); \
+} while (0)
+
+#define WARN_ON(CONDITION) WARN(CONDITION, "%s\n", #CONDITION)
+
#endif /* _LINUX_KERNEL_H_ */
Home |
Main Index |
Thread Index |
Old Index