Commit 18bcd8a0 authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman

staging: rtl8188eu: refactor Efuse_GetCurrentSize()

Refactor while loop in Efuse_GetCurrentSize() to reduce indentation
level and clear line over 80 characters checkpatch warnings.
Signed-off-by: default avatarMichael Straube <straube.linux@gmail.com>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200329100450.10126-1-straube.linux@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ab966667
...@@ -370,7 +370,8 @@ static u16 Efuse_GetCurrentSize(struct adapter *pAdapter) ...@@ -370,7 +370,8 @@ static u16 Efuse_GetCurrentSize(struct adapter *pAdapter)
while (efuse_OneByteRead(pAdapter, efuse_addr, &efuse_data) && while (efuse_OneByteRead(pAdapter, efuse_addr, &efuse_data) &&
AVAILABLE_EFUSE_ADDR(efuse_addr)) { AVAILABLE_EFUSE_ADDR(efuse_addr)) {
if (efuse_data != 0xFF) { if (efuse_data == 0xFF)
break;
if ((efuse_data & 0x1F) == 0x0F) { /* extended header */ if ((efuse_data & 0x1F) == 0x0F) { /* extended header */
hoffset = efuse_data; hoffset = efuse_data;
efuse_addr++; efuse_addr++;
...@@ -379,7 +380,8 @@ static u16 Efuse_GetCurrentSize(struct adapter *pAdapter) ...@@ -379,7 +380,8 @@ static u16 Efuse_GetCurrentSize(struct adapter *pAdapter)
efuse_addr++; efuse_addr++;
continue; continue;
} else { } else {
hoffset = ((hoffset & 0xE0) >> 5) | ((efuse_data & 0xF0) >> 1); hoffset = ((hoffset & 0xE0) >> 5) |
((efuse_data & 0xF0) >> 1);
hworden = efuse_data & 0x0F; hworden = efuse_data & 0x0F;
} }
} else { } else {
...@@ -389,9 +391,6 @@ static u16 Efuse_GetCurrentSize(struct adapter *pAdapter) ...@@ -389,9 +391,6 @@ static u16 Efuse_GetCurrentSize(struct adapter *pAdapter)
word_cnts = Efuse_CalculateWordCnts(hworden); word_cnts = Efuse_CalculateWordCnts(hworden);
/* read next header */ /* read next header */
efuse_addr = efuse_addr + (word_cnts * 2) + 1; efuse_addr = efuse_addr + (word_cnts * 2) + 1;
} else {
break;
}
} }
rtw_hal_set_hwreg(pAdapter, HW_VAR_EFUSE_BYTES, (u8 *)&efuse_addr); rtw_hal_set_hwreg(pAdapter, HW_VAR_EFUSE_BYTES, (u8 *)&efuse_addr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment