]> git.karo-electronics.de Git - linux-beck.git/commitdiff
rtl8xxxu: Skip disabled efuse words early
authorJakub Sitnicki <jsitnicki@gmail.com>
Mon, 29 Feb 2016 22:04:24 +0000 (17:04 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 10 Mar 2016 13:28:58 +0000 (15:28 +0200)
Avoid a negative conditional and an extra level of indentation in the
bigger part of the loop body.

Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c

index c279d6d04eb499cb95b6c39297927d926bcdca0d..7a1c094f1f88af4f70263d541da48c729dd955dd 100644 (file)
@@ -2454,22 +2454,20 @@ static int rtl8xxxu_read_efuse(struct rtl8xxxu_priv *priv)
                }
                for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++) {
                        /* Check word enable condition in the section */
-                       if (!(word_mask & BIT(i))) {
-                               ret = rtl8xxxu_read_efuse8(priv,
-                                                          efuse_addr++,
-                                                          &val8);
-                               if (ret)
-                                       goto exit;
-                               priv->efuse_wifi.raw[map_addr++] = val8;
-
-                               ret = rtl8xxxu_read_efuse8(priv,
-                                                          efuse_addr++,
-                                                          &val8);
-                               if (ret)
-                                       goto exit;
-                               priv->efuse_wifi.raw[map_addr++] = val8;
-                       } else
+                       if (word_mask & BIT(i)) {
                                map_addr += 2;
+                               continue;
+                       }
+
+                       ret = rtl8xxxu_read_efuse8(priv, efuse_addr++, &val8);
+                       if (ret)
+                               goto exit;
+                       priv->efuse_wifi.raw[map_addr++] = val8;
+
+                       ret = rtl8xxxu_read_efuse8(priv, efuse_addr++, &val8);
+                       if (ret)
+                               goto exit;
+                       priv->efuse_wifi.raw[map_addr++] = val8;
                }
        }