]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hw_features: Merge similar return case in check_40mhz_2g4()
authorJouni Malinen <j@w1.fi>
Mon, 29 Jun 2015 17:44:12 +0000 (20:44 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 29 Jun 2015 20:23:56 +0000 (23:23 +0300)
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>
src/common/hw_features_common.c

index e589a1a4650e515de7e411464f4b1b2104fa986f..9c37ea63ca87825cce8312cc3535460508c69ffe 100644 (file)
@@ -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);