[PATCH 1/3] ath10k: add phyerr/dfs handling

Joe Perches joe at perches.com
Tue Oct 29 13:25:01 EDT 2013


On Tue, 2013-10-29 at 13:06 +0100, Marek Puzyniak wrote:
> Handle phyerr, dfs event, radar_report and fft_report.
> Add also debugfs dfs_simulate_radar and dfs_stats files.
> Use ath dfs pattern detector.

Just some simple notes:

> diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
[]
> +#define ATH10K_DFS_STAT(s, p) (\
> +	len += scnprintf(buf + len, size - len, "%28s : %10u\n", s, \
> +			 ar->debug.dfs_stats.p))
> +
> +#define ATH10K_DFS_POOL_STAT(s, p) (\
> +	len += scnprintf(buf + len, size - len, "%28s : %10u\n", s, \
> +			 ar->debug.dfs_pool_stats.p))

You've already got sizes for the description field
might as well use %-28s

> +static ssize_t ath10k_read_file_dfs(struct file *file, char __user *user_buf,
> +				    size_t count, loff_t *ppos)
> +{
> +	int retval = 0, size = 8000, len = 0;

size should either be a #define or a const

[]

> +	len += scnprintf(buf + len, size - len, "Pulse detector statistics:\n");
> +	ATH10K_DFS_STAT("reported phy errors     ", phy_errors);
> +	ATH10K_DFS_STAT("pulse events reported   ", pulses_total);
> +	ATH10K_DFS_STAT("DFS pulses detected     ", pulses_detected);
> +	ATH10K_DFS_STAT("DFS pulses discarded    ", pulses_discarded);
> +	ATH10K_DFS_STAT("Radars detected         ", radar_detected);
> +
> +	len += scnprintf(buf + len, size - len, "Global Pool statistics:\n");
> +	ATH10K_DFS_POOL_STAT("Pool references         ", pool_reference);
> +	ATH10K_DFS_POOL_STAT("Pulses allocated        ", pulse_allocated);
> +	ATH10K_DFS_POOL_STAT("Pulses alloc error      ", pulse_alloc_error);
> +	ATH10K_DFS_POOL_STAT("Pulses in use           ", pulse_used);
> +	ATH10K_DFS_POOL_STAT("Seqs. allocated         ", pseq_allocated);
> +	ATH10K_DFS_POOL_STAT("Seqs. alloc error       ", pseq_alloc_error);
> +	ATH10K_DFS_POOL_STAT("Seqs. in use            ", pseq_used);

If using %-28s, the trailing quoted spaces can be removed.





More information about the ath10k mailing list