rx: Move kernel assertion macros
authorSimon Wilkinson <sxw@your-file-system.com>
Sun, 21 Oct 2012 20:19:40 +0000 (21:19 +0100)
committerDerrick Brashear <shadow@your-file-system.com>
Tue, 30 Oct 2012 11:00:59 +0000 (04:00 -0700)
Move the kernel assertion macros out of rx_prototypes.h and into
rx_kernel.h. This solves an ordering problem if these macros are to
be used from src/rx/<arch>/*.h

Change-Id: I5f11e0802b3d25c1c32a2c646a35c0b59422ab3d
Reviewed-on: http://gerrit.openafs.org/8283
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/rx/rx_kernel.h
src/rx/rx_prototypes.h

index 63f0930..4886536 100644 (file)
@@ -36,7 +36,27 @@ typedef struct socket *osi_socket;
         CM_TRACE_RXWAKE, ICL_TYPE_STRING, __FILE__, ICL_TYPE_INT32, __LINE__)
 
 extern int osi_utoa(char *buf, size_t len, unsigned long val);
-#define osi_Assert(exp) (void)((exp) || (osi_AssertFailK( #exp , __FILE__, __LINE__), 0))
+
+# if defined(AFS_LINUX26_ENV)
+#  define osi_Panic(msg...) \
+    do { printk(KERN_CRIT "openafs: " msg); BUG(); } while (0)
+#  define osi_Assert(expr) \
+    do { \
+       if (!(expr)) \
+           osi_Panic("assertion failed: %s, file: %s, line: %d\n", \
+                     #expr, __FILE__, __LINE__); \
+    } while (0)
+# elif defined(AFS_AIX_ENV)
+extern void osi_Panic(char *fmt, void *a1, void *a2, void *a3);
+#  define osi_Assert(exp) \
+    (void)((exp) || (osi_AssertFailK( #exp , __FILE__, __LINE__), 0))
+# else
+extern void osi_Panic(char *fmt, ...)
+    AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2)
+    AFS_NORETURN;
+#  define osi_Assert(exp) \
+    (void)((exp) || (osi_AssertFailK( #exp , __FILE__, __LINE__), 0))
+# endif
 
 #ifdef AFS_LINUX20_ENV
 # define       osi_Msg printk)(
index 27692e7..eebee69 100644 (file)
@@ -262,18 +262,6 @@ extern int rxk_DelPort(u_short aport);
 extern void rxk_shutdownPorts(void);
 extern osi_socket rxi_GetUDPSocket(u_short port);
 extern osi_socket rxi_GetHostUDPSocket(u_int host, u_short port);
-# if defined(AFS_LINUX26_ENV)
-# define osi_Panic(msg...) do { printk(KERN_CRIT "openafs: " msg); BUG(); } while (0)
-# undef osi_Assert
-# define osi_Assert(expr) \
-    do { if (!(expr)) osi_Panic("assertion failed: %s, file: %s, line: %d\n", #expr, __FILE__, __LINE__); } while (0)
-# elif defined(AFS_AIX_ENV)
-extern void osi_Panic(char *fmt, void *a1, void *a2, void *a3);
-# else
-extern void osi_Panic(char *fmt, ...)
-    AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2)
-    AFS_NORETURN;
-#endif
 extern int osi_utoa(char *buf, size_t len, unsigned long val);
 extern void rxi_InitPeerParams(struct rx_peer *pp);
 extern void shutdown_rxkernel(void);