Search Linux Wireless

Re: [PATCH 2/9] wil6210: add handling of RX HTRSH interrupt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2014-12-01 at 15:33 +0200, Vladimir Kondratiev wrote:
> In addition there's a rate limitted warning message.

limited.

I think this _ratelimited bit should be a separate patch.
(and a suggestion / comment below too)

> diff --git a/drivers/net/wireless/ath/wil6210/debug.c b/drivers/net/wireless/ath/wil6210/debug.c
[]
> +void wil_err_ratelimited(struct wil6210_priv *wil, const char *fmt, ...)
> +{
> +	if (net_ratelimit()) {
> +		struct net_device *ndev = wil_to_ndev(wil);
> +		struct va_format vaf = {
> +			.fmt = fmt,
> +		};
> +		va_list args;
> +
> +		va_start(args, fmt);
> +		vaf.va = &args;
> +		netdev_err(ndev, "%pV", &vaf);
> +		trace_wil6210_log_err(&vaf);
> +		va_end(args);
> +	}
> +}
[]
> diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h
[]
> @@ -475,6 +476,8 @@ void wil_dbg_trace(struct wil6210_priv *wil, const char *fmt, ...);
>  __printf(2, 3)
>  void wil_err(struct wil6210_priv *wil, const char *fmt, ...);
>  __printf(2, 3)
> +void wil_err_ratelimited(struct wil6210_priv *wil, const char *fmt, ...);
> +__printf(2, 3)
>  void wil_info(struct wil6210_priv *wil, const char *fmt, ...);
>  #define wil_dbg(wil, fmt, arg...) do { \
>  	netdev_dbg(wil_to_ndev(wil), fmt, ##arg); \

I think it'd be simpler and smaller to use a macro:

#define wil_err_ratelimited(wil, fmt, ...)		\
do {							\
	if (net_ratelimit())				\
		wil_err(wil, fmt, ##__VA_ARGS__);	\
} while (0)

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux