Skip to content

Commit

Permalink
rtl8xxxu: Skip disabled efuse words early
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jakub Sitnicki authored and Kalle Valo committed Mar 10, 2016
1 parent f6c4770 commit 32a39dd
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 32a39dd

Please sign in to comment.