staging: ks7010: continue from loop on unmatched mac
authorTobin C. Harding <me@tobin.cc>
Thu, 27 Apr 2017 01:25:24 +0000 (11:25 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Apr 2017 09:47:26 +0000 (11:47 +0200)
Inside loop, code block is guarded with an 'if' statement. Instead of
guarding the block we can invert the 'if' statement conditional and
continue the loop. Doing so allows subsequent code indentation to be
reduced and aids the readability of the code.

Invert 'if' statement conditional, continue loop if new conditional
evaluates to true. Reduce subsequent code indentation level. Do not
change program logic.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_hostif.c

index fede3823e95ab36b578bcb11934c2e0a3b8884a3..b19583cd5d7730597b5d292385753e59bf0ae1d0 100644 (file)
@@ -825,13 +825,13 @@ void hostif_scan_indication(struct ks_wlan_private *priv)
        if (priv->scan_ind_count) {
                for (i = 0; i < priv->aplist.size; i++) {       /* bssid check */
                        if (memcmp(ap_info->bssid,
-                                  priv->aplist.ap[i].bssid, ETH_ALEN) == 0) {
-                               if (ap_info->frame_type ==
-                                   FRAME_TYPE_PROBE_RESP)
-                                       get_ap_information(priv, ap_info,
-                                                          &priv->aplist.ap[i]);
-                               return;
-                       }
+                                  priv->aplist.ap[i].bssid, ETH_ALEN) != 0)
+                               continue;
+
+                       if (ap_info->frame_type == FRAME_TYPE_PROBE_RESP)
+                               get_ap_information(priv, ap_info,
+                                                  &priv->aplist.ap[i]);
+                       return;
                }
        }
        priv->scan_ind_count++;