Browse Source

hw_features: Merge similar return case in check_40mhz_2g4()

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>
Jouni Malinen 9 years ago
parent
commit
359636170f
1 changed files with 2 additions and 4 deletions
  1. 2 4
      src/common/hw_features_common.c

+ 2 - 4
src/common/hw_features_common.c

@@ -272,10 +272,8 @@ int check_40mhz_2g4(struct hostapd_hw_modes *mode,
 	int affected_start, affected_end;
 	size_t i;
 
-	if (!mode || !scan_res || !pri_chan || !sec_chan)
-		return 0;
-
-	if (pri_chan == sec_chan)
+	if (!mode || !scan_res || !pri_chan || !sec_chan ||
+	    pri_chan == sec_chan)
 		return 0;
 
 	pri_freq = hw_get_freq(mode, pri_chan);