aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vxge
diff options
context:
space:
mode:
authorJon Mason <jon.mason@exar.com>2010-11-10 23:25:55 -0500
committerDavid S. Miller <davem@davemloft.net>2010-11-11 12:30:20 -0500
commitddd62726e0bc1ffe0ab791b647f4178161ab451b (patch)
tree2a2161577c7944aa0e4f2d2cfd65bddfe534fb65 /drivers/net/vxge
parent4d2a5b406c02b224bd3f50992c8b02450c65a730 (diff)
vxge: cleanup debug printing and asserts
Remove all of the unnecessary debug printk indirection and temporary variables for vxge_debug_ll and vxge_assert. Signed-off-by: Jon Mason <jon.mason@exar.com> Signed-off-by: Ram Vepa <ram.vepa@exar.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxge')
-rw-r--r--drivers/net/vxge/vxge-config.h42
-rw-r--r--drivers/net/vxge/vxge-main.h2
2 files changed, 9 insertions, 35 deletions
diff --git a/drivers/net/vxge/vxge-config.h b/drivers/net/vxge/vxge-config.h
index 95e7021f88d8..b395d8db318a 100644
--- a/drivers/net/vxge/vxge-config.h
+++ b/drivers/net/vxge/vxge-config.h
@@ -20,13 +20,6 @@
20#define VXGE_CACHE_LINE_SIZE 128 20#define VXGE_CACHE_LINE_SIZE 128
21#endif 21#endif
22 22
23#define vxge_os_vaprintf(level, mask, fmt, ...) { \
24 char buff[255]; \
25 snprintf(buff, 255, fmt, __VA_ARGS__); \
26 printk(buff); \
27 printk("\n"); \
28}
29
30#ifndef VXGE_ALIGN 23#ifndef VXGE_ALIGN
31#define VXGE_ALIGN(adrs, size) \ 24#define VXGE_ALIGN(adrs, size) \
32 (((size) - (((u64)adrs) & ((size)-1))) & ((size)-1)) 25 (((size) - (((u64)adrs) & ((size)-1))) & ((size)-1))
@@ -37,7 +30,6 @@
37#define VXGE_HW_DEFAULT_MTU 1500 30#define VXGE_HW_DEFAULT_MTU 1500
38 31
39#ifdef VXGE_DEBUG_ASSERT 32#ifdef VXGE_DEBUG_ASSERT
40
41/** 33/**
42 * vxge_assert 34 * vxge_assert
43 * @test: C-condition to check 35 * @test: C-condition to check
@@ -48,16 +40,13 @@
48 * compilation 40 * compilation
49 * time. 41 * time.
50 */ 42 */
51#define vxge_assert(test) { \ 43#define vxge_assert(test) BUG_ON(!(test))
52 if (!(test)) \
53 vxge_os_bug("bad cond: "#test" at %s:%d\n", \
54 __FILE__, __LINE__); }
55#else 44#else
56#define vxge_assert(test) 45#define vxge_assert(test)
57#endif /* end of VXGE_DEBUG_ASSERT */ 46#endif /* end of VXGE_DEBUG_ASSERT */
58 47
59/** 48/**
60 * enum enum vxge_debug_level 49 * enum vxge_debug_level
61 * @VXGE_NONE: debug disabled 50 * @VXGE_NONE: debug disabled
62 * @VXGE_ERR: all errors going to be logged out 51 * @VXGE_ERR: all errors going to be logged out
63 * @VXGE_TRACE: all errors plus all kind of verbose tracing print outs 52 * @VXGE_TRACE: all errors plus all kind of verbose tracing print outs
@@ -2000,7 +1989,7 @@ enum vxge_hw_status
2000vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask); 1989vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask);
2001 1990
2002/** 1991/**
2003 * vxge_debug 1992 * vxge_debug_ll
2004 * @level: level of debug verbosity. 1993 * @level: level of debug verbosity.
2005 * @mask: mask for the debug 1994 * @mask: mask for the debug
2006 * @buf: Circular buffer for tracing 1995 * @buf: Circular buffer for tracing
@@ -2012,26 +2001,13 @@ vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask);
2012 * may be compiled out if DEBUG macro was never defined. 2001 * may be compiled out if DEBUG macro was never defined.
2013 * See also: enum vxge_debug_level{}. 2002 * See also: enum vxge_debug_level{}.
2014 */ 2003 */
2015
2016#define vxge_trace_aux(level, mask, fmt, ...) \
2017{\
2018 vxge_os_vaprintf(level, mask, fmt, __VA_ARGS__);\
2019}
2020
2021#define vxge_debug(module, level, mask, fmt, ...) { \
2022if ((level >= VXGE_TRACE && ((module & VXGE_DEBUG_TRACE_MASK) == module)) || \
2023 (level >= VXGE_ERR && ((module & VXGE_DEBUG_ERR_MASK) == module))) {\
2024 if ((mask & VXGE_DEBUG_MASK) == mask)\
2025 vxge_trace_aux(level, mask, fmt, __VA_ARGS__); \
2026} \
2027}
2028
2029#if (VXGE_COMPONENT_LL & VXGE_DEBUG_MODULE_MASK) 2004#if (VXGE_COMPONENT_LL & VXGE_DEBUG_MODULE_MASK)
2030#define vxge_debug_ll(level, mask, fmt, ...) \ 2005#define vxge_debug_ll(level, mask, fmt, ...) do { \
2031{\ 2006 if ((level >= VXGE_ERR && VXGE_COMPONENT_LL & VXGE_DEBUG_ERR_MASK) || \
2032 vxge_debug(VXGE_COMPONENT_LL, level, mask, fmt, __VA_ARGS__);\ 2007 (level >= VXGE_TRACE && VXGE_COMPONENT_LL & VXGE_DEBUG_TRACE_MASK))\
2033} 2008 if ((mask & VXGE_DEBUG_MASK) == mask) \
2034 2009 printk(fmt "\n", __VA_ARGS__); \
2010} while (0)
2035#else 2011#else
2036#define vxge_debug_ll(level, mask, fmt, ...) 2012#define vxge_debug_ll(level, mask, fmt, ...)
2037#endif 2013#endif
diff --git a/drivers/net/vxge/vxge-main.h b/drivers/net/vxge/vxge-main.h
index 54989d07af34..3845e628a597 100644
--- a/drivers/net/vxge/vxge-main.h
+++ b/drivers/net/vxge/vxge-main.h
@@ -387,8 +387,6 @@ struct vxge_tx_priv {
387 static int p = val; \ 387 static int p = val; \
388 module_param(p, int, 0) 388 module_param(p, int, 0)
389 389
390#define vxge_os_bug(fmt...) { printk(fmt); BUG(); }
391
392#define vxge_os_timer(timer, handle, arg, exp) do { \ 390#define vxge_os_timer(timer, handle, arg, exp) do { \
393 init_timer(&timer); \ 391 init_timer(&timer); \
394 timer.function = handle; \ 392 timer.function = handle; \