From 71dba7f30c73ea46a93207607e44beb2140c6904 Mon Sep 17 00:00:00 2001 From: Kip Macy Date: Mon, 5 May 2008 22:37:21 +0000 Subject: [PATCH] conditionally define PANIC_IF, remove 'unlikely' --- sys/dev/cxgb/cxgb_osdep.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/dev/cxgb/cxgb_osdep.h b/sys/dev/cxgb/cxgb_osdep.h index 39bc33be3587..ecb1608c425a 100644 --- a/sys/dev/cxgb/cxgb_osdep.h +++ b/sys/dev/cxgb/cxgb_osdep.h @@ -61,10 +61,12 @@ struct t3_mbuf_hdr { struct mbuf *mh_tail; }; +#ifndef PANIC_IF #define PANIC_IF(exp) do { \ if (exp) \ panic("BUG: %s", #exp); \ } while (0) +#endif #define m_get_priority(m) ((uintptr_t)(m)->m_pkthdr.rcvif) #define m_set_priority(m, pri) ((m)->m_pkthdr.rcvif = (struct ifnet *)((uintptr_t)pri)) @@ -132,9 +134,6 @@ void cxgb_log_tcb(struct adapter *sc, unsigned int tid); #define TX_START_MIN_DESC (TX_MAX_DESC << 2) - - - #define TX_START_MAX_DESC (TX_MAX_DESC << 3) /* maximum number of descriptors * call to start used per */ @@ -164,7 +163,7 @@ void prefetch(void *x) extern void kdb_backtrace(void); #define WARN_ON(condition) do { \ - if (unlikely((condition)!=0)) { \ + if (__predict_false((condition)!=0)) { \ log(LOG_WARNING, "BUG: warning at %s:%d/%s()\n", __FILE__, __LINE__, __FUNCTION__); \ kdb_backtrace(); \ } \