Message ID | 1400668835-22335-1-git-send-email-zefir.kurtisi@neratec.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Zefir Kurtisi <zefir.kurtisi@neratec.com> writes: > DFS pulse interval printing is only available > when CONFIG_ATH9K_DEBUGFS is set. > > Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com> [...] > --- a/drivers/net/wireless/ath/ath9k/dfs.c > +++ b/drivers/net/wireless/ath/ath9k/dfs.c > @@ -178,12 +178,14 @@ void ath9k_dfs_process_phyerr(struct ath_softc *sc, void *data, > pe.ts = mactime; > if (ath9k_postprocess_radar_event(sc, &ard, &pe)) { > struct dfs_pattern_detector *pd = sc->dfs_detector; > +#ifdef CONFIG_ATH9K_DEBUGFS IMHO config_enabled() is much nicer than ifdef.
On 05/22/2014 03:15 PM, Kalle Valo wrote: > Zefir Kurtisi <zefir.kurtisi@neratec.com> writes: > >> DFS pulse interval printing is only available >> when CONFIG_ATH9K_DEBUGFS is set. >> >> Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com> > > [...] > >> --- a/drivers/net/wireless/ath/ath9k/dfs.c >> +++ b/drivers/net/wireless/ath/ath9k/dfs.c >> @@ -178,12 +178,14 @@ void ath9k_dfs_process_phyerr(struct ath_softc *sc, void *data, >> pe.ts = mactime; >> if (ath9k_postprocess_radar_event(sc, &ard, &pe)) { >> struct dfs_pattern_detector *pd = sc->dfs_detector; >> +#ifdef CONFIG_ATH9K_DEBUGFS > > IMHO config_enabled() is much nicer than ifdef. > Actually, I dislike both of them. While this is for debug printing only, it is still a bad idea to use variables in debugfs dependent space and splatter source code with required checks. I'll move that into a different context and post a follow-up patch. John, please drop this one. -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, May 23, 2014 at 10:15:08AM +0200, Zefir Kurtisi wrote: > On 05/22/2014 03:15 PM, Kalle Valo wrote: > > Zefir Kurtisi <zefir.kurtisi@neratec.com> writes: > > > >> DFS pulse interval printing is only available > >> when CONFIG_ATH9K_DEBUGFS is set. > >> > >> Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com> > > > > [...] > > > >> --- a/drivers/net/wireless/ath/ath9k/dfs.c > >> +++ b/drivers/net/wireless/ath/ath9k/dfs.c > >> @@ -178,12 +178,14 @@ void ath9k_dfs_process_phyerr(struct ath_softc *sc, void *data, > >> pe.ts = mactime; > >> if (ath9k_postprocess_radar_event(sc, &ard, &pe)) { > >> struct dfs_pattern_detector *pd = sc->dfs_detector; > >> +#ifdef CONFIG_ATH9K_DEBUGFS > > > > IMHO config_enabled() is much nicer than ifdef. > > > > Actually, I dislike both of them. > > While this is for debug printing only, it is still a bad idea to use variables in > debugfs dependent space and splatter source code with required checks. I'll move > that into a different context and post a follow-up patch. > > > John, please drop this one. Actually, I merged it yesterday. Please submit your follow-up patch on top of this one. John
diff --git a/drivers/net/wireless/ath/ath9k/dfs.c b/drivers/net/wireless/ath/ath9k/dfs.c index 5049bec..e0c740d 100644 --- a/drivers/net/wireless/ath/ath9k/dfs.c +++ b/drivers/net/wireless/ath/ath9k/dfs.c @@ -178,12 +178,14 @@ void ath9k_dfs_process_phyerr(struct ath_softc *sc, void *data, pe.ts = mactime; if (ath9k_postprocess_radar_event(sc, &ard, &pe)) { struct dfs_pattern_detector *pd = sc->dfs_detector; +#ifdef CONFIG_ATH9K_DEBUGFS ath_dbg(common, DFS, "ath9k_dfs_process_phyerr: channel=%d, ts=%llu, " "width=%d, rssi=%d, delta_ts=%llu\n", pe.freq, pe.ts, pe.width, pe.rssi, pe.ts - sc->debug.stats.dfs_stats.last_ts); sc->debug.stats.dfs_stats.last_ts = pe.ts; +#endif DFS_STAT_INC(sc, pulses_processed); if (pd != NULL && pd->add_pulse(pd, &pe)) { DFS_STAT_INC(sc, radar_detected);
DFS pulse interval printing is only available when CONFIG_ATH9K_DEBUGFS is set. Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com> --- drivers/net/wireless/ath/ath9k/dfs.c | 2 ++ 1 file changed, 2 insertions(+)