diff options
author | Shashikala Prabhu <pshashik@codeaurora.org> | 2018-02-11 15:30:52 +0530 |
---|---|---|
committer | snandini <snandini@codeaurora.org> | 2018-02-15 03:12:50 -0800 |
commit | 1b50fdc45110343c0df389d576a8861b726666d3 (patch) | |
tree | 99e5a653f3f25b2b77c0d889c98af02075b4249e /umac | |
parent | 9d7dc27fe2abf4a95f3164fe9b9b120994e33b89 (diff) | |
download | qca-wfi-host-cmn-1b50fdc45110343c0df389d576a8861b726666d3.tar.gz |
qcacmn: Add a local variable to dereference frequency range
To make the code look neater, add a local variable to dereference the
frequency range.
Change-Id: I419aa913304c3b7e7d553a1419b92f9ee46ac754
CRs-Fixed: 2182461
Diffstat (limited to 'umac')
-rw-r--r-- | umac/regulatory/core/src/reg_services.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/umac/regulatory/core/src/reg_services.c b/umac/regulatory/core/src/reg_services.c index c707b73ed..1471c743b 100644 --- a/umac/regulatory/core/src/reg_services.c +++ b/umac/regulatory/core/src/reg_services.c @@ -3846,6 +3846,7 @@ static QDF_STATUS reg_process_ch_avoid_freq(struct wlan_objmgr_psoc *psoc, uint16_t end_channel; uint32_t i; struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj; + struct ch_avoid_freq_type *range; psoc_priv_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc, WLAN_UMAC_COMP_REGULATORY); @@ -3864,14 +3865,12 @@ static QDF_STATUS reg_process_ch_avoid_freq(struct wlan_objmgr_psoc *psoc, start_ch_idx = INVALID_CHANNEL; end_ch_idx = INVALID_CHANNEL; - start_channel = reg_freq_to_chan(pdev, - psoc_priv_obj->avoid_freq_list.avoid_freq_range[i].start_freq); - end_channel = reg_freq_to_chan(pdev, - psoc_priv_obj->avoid_freq_list.avoid_freq_range[i].end_freq); + range = &psoc_priv_obj->avoid_freq_list.avoid_freq_range[i]; + + start_channel = reg_freq_to_chan(pdev, range->start_freq); + end_channel = reg_freq_to_chan(pdev, range->end_freq); reg_debug("start: freq %d, ch %d, end: freq %d, ch %d", - psoc_priv_obj->avoid_freq_list.avoid_freq_range[i].start_freq, - start_channel, - psoc_priv_obj->avoid_freq_list.avoid_freq_range[i].end_freq, + range->start_freq, start_channel, range->end_freq, end_channel); /* do not process frequency bands that are not mapped to @@ -3882,19 +3881,16 @@ static QDF_STATUS reg_process_ch_avoid_freq(struct wlan_objmgr_psoc *psoc, for (ch_loop = 0; ch_loop < NUM_CHANNELS; ch_loop++) { - if (REG_CH_TO_FREQ(ch_loop) >= - psoc_priv_obj->avoid_freq_list.avoid_freq_range[i].start_freq) { + if (REG_CH_TO_FREQ(ch_loop) >= range->start_freq) { start_ch_idx = ch_loop; break; } } for (ch_loop = 0; ch_loop < NUM_CHANNELS; ch_loop++) { - if (REG_CH_TO_FREQ(ch_loop) >= - psoc_priv_obj->avoid_freq_list.avoid_freq_range[i].end_freq) { + if (REG_CH_TO_FREQ(ch_loop) >= range->end_freq) { end_ch_idx = ch_loop; - if (REG_CH_TO_FREQ(ch_loop) > - psoc_priv_obj->avoid_freq_list.avoid_freq_range[i].end_freq) + if (REG_CH_TO_FREQ(ch_loop) > range->end_freq) end_ch_idx--; break; } |