wifi: ath: dfs_pattern_detector: Use flex array to simplify code
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 30 Sep 2023 04:54:48 +0000 (07:54 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Mon, 2 Oct 2023 16:58:33 +0000 (19:58 +0300)
commit27e154abf6940d6478ca698019fb1ce783e85602
tree478ae0b152d0b757a80eda1b5a78304b4a87847f
parent79bd60ee87e1136718a686d6617ced5de88ee350
wifi: ath: dfs_pattern_detector: Use flex array to simplify code

At the time of the writing, the value of 'num_radar_types' is 7 or 9. So
on a 64 bits system, only 56 or 72 bytes are allocated for the
'detectors' array.

Turn it into a flex array, in order to simplify memory management and save
an indirection when the array is used.

Doing so, cd->detectors can't be NULL, and channel_detector_exit() can be
simplified as well.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/1920cc38db2e570633e13b37d50852f3202a7270.1695538105.git.christophe.jaillet@wanadoo.fr
drivers/net/wireless/ath/dfs_pattern_detector.c