hw_features: Merge similar return cases
There is no need to have separate return statements for these corner cases that are unlikely to be hit in practice. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
24f4ad04f7
commit
5ed6519625
1 changed files with 9 additions and 14 deletions
|
@ -176,10 +176,8 @@ int check_40mhz_5g(struct hostapd_hw_modes *mode,
|
||||||
size_t i;
|
size_t i;
|
||||||
int match;
|
int match;
|
||||||
|
|
||||||
if (!mode || !scan_res || !pri_chan || !sec_chan)
|
if (!mode || !scan_res || !pri_chan || !sec_chan ||
|
||||||
return 0;
|
pri_chan == sec_chan)
|
||||||
|
|
||||||
if (pri_chan == sec_chan)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pri_freq = hw_get_freq(mode, pri_chan);
|
pri_freq = hw_get_freq(mode, pri_chan);
|
||||||
|
@ -373,11 +371,10 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
|
||||||
|
|
||||||
if (data->vht_enabled) switch (vht_oper_chwidth) {
|
if (data->vht_enabled) switch (vht_oper_chwidth) {
|
||||||
case VHT_CHANWIDTH_USE_HT:
|
case VHT_CHANWIDTH_USE_HT:
|
||||||
if (center_segment1)
|
if (center_segment1 ||
|
||||||
return -1;
|
(center_segment0 != 0 &&
|
||||||
if (center_segment0 != 0 &&
|
5000 + center_segment0 * 5 != data->center_freq1 &&
|
||||||
5000 + center_segment0 * 5 != data->center_freq1 &&
|
2407 + center_segment0 * 5 != data->center_freq1))
|
||||||
2407 + center_segment0 * 5 != data->center_freq1)
|
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
break;
|
||||||
case VHT_CHANWIDTH_80P80MHZ:
|
case VHT_CHANWIDTH_80P80MHZ:
|
||||||
|
@ -393,11 +390,9 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case VHT_CHANWIDTH_80MHZ:
|
case VHT_CHANWIDTH_80MHZ:
|
||||||
data->bandwidth = 80;
|
data->bandwidth = 80;
|
||||||
if (vht_oper_chwidth == 1 && center_segment1)
|
if ((vht_oper_chwidth == 1 && center_segment1) ||
|
||||||
return -1;
|
(vht_oper_chwidth == 3 && !center_segment1) ||
|
||||||
if (vht_oper_chwidth == 3 && !center_segment1)
|
!sec_channel_offset)
|
||||||
return -1;
|
|
||||||
if (!sec_channel_offset)
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!center_segment0) {
|
if (!center_segment0) {
|
||||||
if (channel <= 48)
|
if (channel <= 48)
|
||||||
|
|
Loading…
Add table
Reference in a new issue