mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
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>
This commit is contained in:
parent
4d2a5b406c
commit
ddd62726e0
2 changed files with 9 additions and 35 deletions
|
@ -20,13 +20,6 @@
|
||||||
#define VXGE_CACHE_LINE_SIZE 128
|
#define VXGE_CACHE_LINE_SIZE 128
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define vxge_os_vaprintf(level, mask, fmt, ...) { \
|
|
||||||
char buff[255]; \
|
|
||||||
snprintf(buff, 255, fmt, __VA_ARGS__); \
|
|
||||||
printk(buff); \
|
|
||||||
printk("\n"); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef VXGE_ALIGN
|
#ifndef VXGE_ALIGN
|
||||||
#define VXGE_ALIGN(adrs, size) \
|
#define VXGE_ALIGN(adrs, size) \
|
||||||
(((size) - (((u64)adrs) & ((size)-1))) & ((size)-1))
|
(((size) - (((u64)adrs) & ((size)-1))) & ((size)-1))
|
||||||
|
@ -37,7 +30,6 @@
|
||||||
#define VXGE_HW_DEFAULT_MTU 1500
|
#define VXGE_HW_DEFAULT_MTU 1500
|
||||||
|
|
||||||
#ifdef VXGE_DEBUG_ASSERT
|
#ifdef VXGE_DEBUG_ASSERT
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* vxge_assert
|
* vxge_assert
|
||||||
* @test: C-condition to check
|
* @test: C-condition to check
|
||||||
|
@ -48,16 +40,13 @@
|
||||||
* compilation
|
* compilation
|
||||||
* time.
|
* time.
|
||||||
*/
|
*/
|
||||||
#define vxge_assert(test) { \
|
#define vxge_assert(test) BUG_ON(!(test))
|
||||||
if (!(test)) \
|
|
||||||
vxge_os_bug("bad cond: "#test" at %s:%d\n", \
|
|
||||||
__FILE__, __LINE__); }
|
|
||||||
#else
|
#else
|
||||||
#define vxge_assert(test)
|
#define vxge_assert(test)
|
||||||
#endif /* end of VXGE_DEBUG_ASSERT */
|
#endif /* end of VXGE_DEBUG_ASSERT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* enum enum vxge_debug_level
|
* enum vxge_debug_level
|
||||||
* @VXGE_NONE: debug disabled
|
* @VXGE_NONE: debug disabled
|
||||||
* @VXGE_ERR: all errors going to be logged out
|
* @VXGE_ERR: all errors going to be logged out
|
||||||
* @VXGE_TRACE: all errors plus all kind of verbose tracing print outs
|
* @VXGE_TRACE: all errors plus all kind of verbose tracing print outs
|
||||||
|
@ -2000,7 +1989,7 @@ enum vxge_hw_status
|
||||||
vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask);
|
vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* vxge_debug
|
* vxge_debug_ll
|
||||||
* @level: level of debug verbosity.
|
* @level: level of debug verbosity.
|
||||||
* @mask: mask for the debug
|
* @mask: mask for the debug
|
||||||
* @buf: Circular buffer for tracing
|
* @buf: Circular buffer for tracing
|
||||||
|
@ -2012,26 +2001,13 @@ vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask);
|
||||||
* may be compiled out if DEBUG macro was never defined.
|
* may be compiled out if DEBUG macro was never defined.
|
||||||
* See also: enum vxge_debug_level{}.
|
* See also: enum vxge_debug_level{}.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define vxge_trace_aux(level, mask, fmt, ...) \
|
|
||||||
{\
|
|
||||||
vxge_os_vaprintf(level, mask, fmt, __VA_ARGS__);\
|
|
||||||
}
|
|
||||||
|
|
||||||
#define vxge_debug(module, level, mask, fmt, ...) { \
|
|
||||||
if ((level >= VXGE_TRACE && ((module & VXGE_DEBUG_TRACE_MASK) == module)) || \
|
|
||||||
(level >= VXGE_ERR && ((module & VXGE_DEBUG_ERR_MASK) == module))) {\
|
|
||||||
if ((mask & VXGE_DEBUG_MASK) == mask)\
|
|
||||||
vxge_trace_aux(level, mask, fmt, __VA_ARGS__); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#if (VXGE_COMPONENT_LL & VXGE_DEBUG_MODULE_MASK)
|
#if (VXGE_COMPONENT_LL & VXGE_DEBUG_MODULE_MASK)
|
||||||
#define vxge_debug_ll(level, mask, fmt, ...) \
|
#define vxge_debug_ll(level, mask, fmt, ...) do { \
|
||||||
{\
|
if ((level >= VXGE_ERR && VXGE_COMPONENT_LL & VXGE_DEBUG_ERR_MASK) || \
|
||||||
vxge_debug(VXGE_COMPONENT_LL, level, mask, fmt, __VA_ARGS__);\
|
(level >= VXGE_TRACE && VXGE_COMPONENT_LL & VXGE_DEBUG_TRACE_MASK))\
|
||||||
}
|
if ((mask & VXGE_DEBUG_MASK) == mask) \
|
||||||
|
printk(fmt "\n", __VA_ARGS__); \
|
||||||
|
} while (0)
|
||||||
#else
|
#else
|
||||||
#define vxge_debug_ll(level, mask, fmt, ...)
|
#define vxge_debug_ll(level, mask, fmt, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -387,8 +387,6 @@ struct vxge_tx_priv {
|
||||||
static int p = val; \
|
static int p = val; \
|
||||||
module_param(p, int, 0)
|
module_param(p, int, 0)
|
||||||
|
|
||||||
#define vxge_os_bug(fmt...) { printk(fmt); BUG(); }
|
|
||||||
|
|
||||||
#define vxge_os_timer(timer, handle, arg, exp) do { \
|
#define vxge_os_timer(timer, handle, arg, exp) do { \
|
||||||
init_timer(&timer); \
|
init_timer(&timer); \
|
||||||
timer.function = handle; \
|
timer.function = handle; \
|
||||||
|
|
Loading…
Reference in a new issue