[PATCH] ath10k: add configurable debugging.

Steve deRosier derosier at gmail.com
Wed May 10 09:44:23 PDT 2017


Hi Adrian,

On Wed, May 10, 2017 at 9:25 AM, Adrian Chadd <adrian at freebsd.org> wrote:

> diff --git a/drivers/net/wireless/ath/ath10k/debug.h b/drivers/net/wireless/ath/ath10k/debug.h
> index 257d10985c6e..7bd461927029 100644
> --- a/drivers/net/wireless/ath/ath10k/debug.h
> +++ b/drivers/net/wireless/ath/ath10k/debug.h
> @@ -200,27 +200,43 @@ void ath10k_sta_update_rx_duration(struct ath10k *ar,
>  #endif /* CONFIG_MAC80211_DEBUGFS */
>
>  #ifdef CONFIG_ATH10K_DEBUG
> -__printf(3, 4) void ath10k_dbg(struct ath10k *ar,
> +static inline int
> +_ath10k_do_dbg(struct ath10k *ar, enum ath10k_debug_mask mask)
> +{
> +       if (ar->trace_debug_mask & mask)
> +               return (1);
> +       if (ar->debug_mask & mask)
> +               return (1);
> +       return (0);
> +}
> +
> +void _ath10k_dbg(struct ath10k *ar,
>                                enum ath10k_debug_mask mask,
>                                const char *fmt, ...);
> -void ath10k_dbg_dump(struct ath10k *ar,
> +
> +void _ath10k_dbg_dump(struct ath10k *ar,
>                      enum ath10k_debug_mask mask,
>                      const char *msg, const char *prefix,
>                      const void *buf, size_t len);
> +
> +#define        ath10k_dbg(ar, mask, ...)                                       \
> +       do {                                                            \
> +               if (_ath10k_do_dbg(ar, mask)) {                         \
> +                       _ath10k_dbg((ar), (mask), __VA_ARGS__);         \
> +               };                                                      \
> +       } while (0)
> +

Looks to me you dropped the "__printf(3, 4)" safety check. Was that intentional?

Thanks,
- Steve



More information about the ath10k mailing list