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/asm Make Linux WARN_*...
details: https://anonhg.NetBSD.org/src/rev/1e90e942633a
branches: riastradh-drm2
changeset: 788279:1e90e942633a
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Jul 24 03:02:51 2013 +0000
description:
Make Linux WARN_* macros expand to expressions, not statements.
These are to return the value of the condition.
diffstat:
sys/external/bsd/drm2/include/asm/bug.h | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diffs (30 lines):
diff -r 267b43888916 -r 1e90e942633a sys/external/bsd/drm2/include/asm/bug.h
--- a/sys/external/bsd/drm2/include/asm/bug.h Wed Jul 24 03:02:35 2013 +0000
+++ b/sys/external/bsd/drm2/include/asm/bug.h Wed Jul 24 03:02:51 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bug.h,v 1.1.2.4 2013/07/24 02:56:03 riastradh Exp $ */
+/* $NetBSD: bug.h,v 1.1.2.5 2013/07/24 03:02:51 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -39,14 +39,14 @@
#define BUG_ON(CONDITION) KASSERT(!(CONDITION))
/* XXX Rate limit? */
-#define WARN(CONDITION, FMT, ...) do \
-{ \
- if (CONDITION) \
- printf("warning: %s:%d: " FMT, __FILE__, __LINE__, \
- ##__VA_ARGS__); \
-} while (0)
+#define WARN(CONDITION, FMT, ...) \
+ ((CONDITION)? \
+ (printf("warning: %s:%d: " FMT, __FILE__, __LINE__, \
+ ##__VA_ARGS__), 1) \
+ : 0)
#define WARN_ON(CONDITION) WARN(CONDITION, "%s\n", #CONDITION)
#define WARN_ON_SMP(CONDITION) WARN_ON(CONDITION) /* XXX */
+#define WARN_ON_ONCE(CONDITION) WARN_ON(CONDITION) /* XXX */
#endif /* _ASM_BUG_H_ */
Home |
Main Index |
Thread Index |
Old Index