Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: don't assume channel is set in tracing

With the move to multi-channel and away from
drv_config(), hw.conf.channel will not always
be set, only for devices using the current API
instead of the new channel context APIs. Check
the channel is set before adding its frequency
to the trace data.

Also break some overly long lines in the code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>

+6 -3
+6 -3
net/mac80211/trace.h
··· 274 274 __entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout; 275 275 __entry->max_sleep_period = local->hw.conf.max_sleep_period; 276 276 __entry->listen_interval = local->hw.conf.listen_interval; 277 - __entry->long_frame_max_tx_count = local->hw.conf.long_frame_max_tx_count; 278 - __entry->short_frame_max_tx_count = local->hw.conf.short_frame_max_tx_count; 279 - __entry->center_freq = local->hw.conf.channel->center_freq; 277 + __entry->long_frame_max_tx_count = 278 + local->hw.conf.long_frame_max_tx_count; 279 + __entry->short_frame_max_tx_count = 280 + local->hw.conf.short_frame_max_tx_count; 281 + __entry->center_freq = local->hw.conf.channel ? 282 + local->hw.conf.channel->center_freq : 0; 280 283 __entry->channel_type = local->hw.conf.channel_type; 281 284 __entry->smps = local->hw.conf.smps_mode; 282 285 ),