Commit 8017f5ac authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman

staging: rtl8723bs: remove redundant variable hoffset

Variable hoffset in functions hal_EfuseGetCurrentSize_WiFi and
hal_EfuseGetCurrentSize_BT is being assigned a value but it not
being read for any useful reason at all. The variable is redundant
and can be removed.

Cleans up clang scan build warnings for lines 957 and 1050:
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:957:5: warning:
variable 'hoffset' set but not used [-Wunused-but-set-variable]
Signed-off-by: default avatarColin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20240304161045.769912-1-colin.i.king@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6fd52966
...@@ -954,7 +954,7 @@ static u16 hal_EfuseGetCurrentSize_WiFi( ...@@ -954,7 +954,7 @@ static u16 hal_EfuseGetCurrentSize_WiFi(
#endif #endif
u16 efuse_addr = 0; u16 efuse_addr = 0;
u16 start_addr = 0; /* for debug */ u16 start_addr = 0; /* for debug */
u8 hoffset = 0, hworden = 0; u8 hworden = 0;
u8 efuse_data, word_cnts = 0; u8 efuse_data, word_cnts = 0;
u32 count = 0; /* for debug */ u32 count = 0; /* for debug */
...@@ -1001,16 +1001,13 @@ static u16 hal_EfuseGetCurrentSize_WiFi( ...@@ -1001,16 +1001,13 @@ static u16 hal_EfuseGetCurrentSize_WiFi(
} }
if (EXT_HEADER(efuse_data)) { if (EXT_HEADER(efuse_data)) {
hoffset = GET_HDR_OFFSET_2_0(efuse_data);
efuse_addr++; efuse_addr++;
efuse_OneByteRead(padapter, efuse_addr, &efuse_data, bPseudoTest); efuse_OneByteRead(padapter, efuse_addr, &efuse_data, bPseudoTest);
if (ALL_WORDS_DISABLED(efuse_data)) if (ALL_WORDS_DISABLED(efuse_data))
continue; continue;
hoffset |= ((efuse_data & 0xF0) >> 1);
hworden = efuse_data & 0x0F; hworden = efuse_data & 0x0F;
} else { } else {
hoffset = (efuse_data>>4) & 0x0F;
hworden = efuse_data & 0x0F; hworden = efuse_data & 0x0F;
} }
...@@ -1047,7 +1044,7 @@ static u16 hal_EfuseGetCurrentSize_BT(struct adapter *padapter, u8 bPseudoTest) ...@@ -1047,7 +1044,7 @@ static u16 hal_EfuseGetCurrentSize_BT(struct adapter *padapter, u8 bPseudoTest)
u16 btusedbytes; u16 btusedbytes;
u16 efuse_addr; u16 efuse_addr;
u8 bank, startBank; u8 bank, startBank;
u8 hoffset = 0, hworden = 0; u8 hworden = 0;
u8 efuse_data, word_cnts = 0; u8 efuse_data, word_cnts = 0;
u16 retU2 = 0; u16 retU2 = 0;
...@@ -1085,7 +1082,6 @@ static u16 hal_EfuseGetCurrentSize_BT(struct adapter *padapter, u8 bPseudoTest) ...@@ -1085,7 +1082,6 @@ static u16 hal_EfuseGetCurrentSize_BT(struct adapter *padapter, u8 bPseudoTest)
break; break;
if (EXT_HEADER(efuse_data)) { if (EXT_HEADER(efuse_data)) {
hoffset = GET_HDR_OFFSET_2_0(efuse_data);
efuse_addr++; efuse_addr++;
efuse_OneByteRead(padapter, efuse_addr, &efuse_data, bPseudoTest); efuse_OneByteRead(padapter, efuse_addr, &efuse_data, bPseudoTest);
...@@ -1094,11 +1090,8 @@ static u16 hal_EfuseGetCurrentSize_BT(struct adapter *padapter, u8 bPseudoTest) ...@@ -1094,11 +1090,8 @@ static u16 hal_EfuseGetCurrentSize_BT(struct adapter *padapter, u8 bPseudoTest)
continue; continue;
} }
/* hoffset = ((hoffset & 0xE0) >> 5) | ((efuse_data & 0xF0) >> 1); */
hoffset |= ((efuse_data & 0xF0) >> 1);
hworden = efuse_data & 0x0F; hworden = efuse_data & 0x0F;
} else { } else {
hoffset = (efuse_data>>4) & 0x0F;
hworden = efuse_data & 0x0F; hworden = efuse_data & 0x0F;
} }
...@@ -1114,18 +1107,15 @@ static u16 hal_EfuseGetCurrentSize_BT(struct adapter *padapter, u8 bPseudoTest) ...@@ -1114,18 +1107,15 @@ static u16 hal_EfuseGetCurrentSize_BT(struct adapter *padapter, u8 bPseudoTest)
) { ) {
if (efuse_data != 0xFF) { if (efuse_data != 0xFF) {
if ((efuse_data&0x1F) == 0x0F) { /* extended header */ if ((efuse_data&0x1F) == 0x0F) { /* extended header */
hoffset = efuse_data;
efuse_addr++; efuse_addr++;
efuse_OneByteRead(padapter, efuse_addr, &efuse_data, bPseudoTest); efuse_OneByteRead(padapter, efuse_addr, &efuse_data, bPseudoTest);
if ((efuse_data & 0x0F) == 0x0F) { if ((efuse_data & 0x0F) == 0x0F) {
efuse_addr++; efuse_addr++;
continue; continue;
} else { } else {
hoffset = ((hoffset & 0xE0) >> 5) | ((efuse_data & 0xF0) >> 1);
hworden = efuse_data & 0x0F; hworden = efuse_data & 0x0F;
} }
} else { } else {
hoffset = (efuse_data>>4) & 0x0F;
hworden = efuse_data & 0x0F; hworden = efuse_data & 0x0F;
} }
word_cnts = Efuse_CalculateWordCnts(hworden); word_cnts = Efuse_CalculateWordCnts(hworden);
......
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