From b1999f459856fc327d7fa3969aabbea232678386 Mon Sep 17 00:00:00 2001 From: coypu Date: Fri, 16 Sep 2016 15:19:30 +0300 Subject: [PATCH 11/27] Make HALDEBUG like other debug printf functions avoid complaints of unused things in non-DEBUG case thanks dholland for suggestion --- sys/external/isc/atheros_hal/ic/ah_osdep.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/sys/external/isc/atheros_hal/ic/ah_osdep.c b/sys/external/isc/atheros_hal/ic/ah_osdep.c index 919506a..e68838b 100644 --- a/sys/external/isc/atheros_hal/ic/ah_osdep.c +++ b/sys/external/isc/atheros_hal/ic/ah_osdep.c @@ -64,10 +64,6 @@ extern void ath_hal_free(void *); extern void ath_hal_assert_failed(const char* filename, int lineno, const char* msg); #endif -#ifdef ATHHAL_DEBUG -extern void HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) - __printflike(3,4); -#endif /* ATHHAL_DEBUG */ #ifdef ATHHAL_DEBUG static int ath_hal_debug = 0; @@ -170,17 +166,14 @@ ath_hal_ether_sprintf(const u_int8_t *mac) } #ifdef ATHHAL_DEBUG -void -HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) -{ - if (ath_hal_debug & mask) { - va_list ap; - va_start(ap, fmt); - ath_hal_vprintf(ah, fmt, ap); - va_end(ap); +#define HALDEBUG(ath_hal, mask, fmt, args...) \ + if (ath_hal_debug & mask) { \ + printf("%s: " fmt, __func__, ##args); \ } -} -#endif /* ATHHAL_DEBUG */ +#else +#define HALDEBUG(ath_hal, mask, fmt, args...) \ + ((void)(ath_hal), (void)(mask), (void)(fmt), (void)(args), (void)0) +#endif #ifdef ATHHAL_DEBUG_ALQ /* -- 2.9.3