Module Name:    src
Committed By:   riastradh
Date:           Wed Jul 24 03:25:28 UTC 2013

Modified Files:
        src/sys/external/bsd/drm2/include/asm [riastradh-drm2]: bug.h

Log Message:
Use an intermediate call in WARN* to avoid GCC compiler warnings.

For some reason this shuts it up about statements without effect.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/external/bsd/drm2/include/asm/bug.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/asm/bug.h
diff -u src/sys/external/bsd/drm2/include/asm/bug.h:1.1.2.5 src/sys/external/bsd/drm2/include/asm/bug.h:1.1.2.6
--- src/sys/external/bsd/drm2/include/asm/bug.h:1.1.2.5	Wed Jul 24 03:02:51 2013
+++ src/sys/external/bsd/drm2/include/asm/bug.h	Wed Jul 24 03:25:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bug.h,v 1.1.2.5 2013/07/24 03:02:51 riastradh Exp $	*/
+/*	$NetBSD: bug.h,v 1.1.2.6 2013/07/24 03:25:28 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 
 /* XXX Rate limit?  */
 #define WARN(CONDITION, FMT, ...)					\
-	((CONDITION)?							\
+	linux_warning((CONDITION)?					\
 	    (printf("warning: %s:%d: " FMT, __FILE__, __LINE__,		\
 		##__VA_ARGS__), 1)					\
 	    : 0)
@@ -49,4 +49,11 @@
 #define	WARN_ON_SMP(CONDITION)	WARN_ON(CONDITION) /* XXX */
 #define	WARN_ON_ONCE(CONDITION)	WARN_ON(CONDITION) /* XXX */
 
+/* XXX Kludge to avoid GCC warning about statements without effect.  */
+static inline int
+linux_warning(int x)
+{
+	return x;
+}
+
 #endif  /* _ASM_BUG_H_ */

Reply via email to