Skip to contentSkip to conversation

staging: r8188eu: remove redundant variable hoffset

PATCH In review Colin King 2 participants 2 messages Sep 7, 2021

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 staging: r8188eu: remove redundant variable hoffset

From: Colin Ian King <[email protected]>

Variable hoffset is being assigned values but it is never being used. The variable is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +1 -4
index 14758361960c..7c12ca548c47 100644
@@ -1143,7 +1143,7 @@ static u16 hal_EfuseGetCurrentSize_8188e(struct adapter *pAdapter, bool bPseudoT
 {
 	int	bContinual = true;
 	u16	efuse_addr = 0;
-	u8 hoffset = 0, hworden = 0;
+	u8 hworden = 0;
 	u8 efuse_data, word_cnts = 0;
 
 	if (bPseudoTest)
@@ -1156,18 +1156,15 @@ static u16 hal_EfuseGetCurrentSize_8188e(struct adapter *pAdapter, bool bPseudoT
 	       AVAILABLE_EFUSE_ADDR(efuse_addr)) {
 		if (efuse_data != 0xFF) {
 			if ((efuse_data & 0x1F) == 0x0F) {		/* extended header */
-				hoffset = efuse_data;
 				efuse_addr++;
 				efuse_OneByteRead(pAdapter, efuse_addr, &efuse_data, bPseudoTest);
 				if ((efuse_data & 0x0F) == 0x0F) {
 					efuse_addr++;
 					continue;
 				} else {
-					hoffset = ((hoffset & 0xE0) >> 5) | ((efuse_data & 0xF0) >> 1);
 					hworden = efuse_data & 0x0F;
 				}
 			} else {
-				hoffset = (efuse_data >> 4) & 0x0F;
 				hworden =  efuse_data & 0x0F;
 			}
 			word_cnts = Efuse_CalculateWordCnts(hworden);
Signature · 1 line
2.32.0
Acked-by on v1 1/1
#1 lore raw
Quoted 46 lines · Colin King

From: Colin Ian King <[email protected]>

Variable hoffset is being assigned values but it is never being used. The variable is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +1 -4
index 14758361960c..7c12ca548c47 100644
@@ -1143,7 +1143,7 @@ static u16 hal_EfuseGetCurrentSize_8188e(struct adapter *pAdapter, bool bPseudoT
 {
 	int	bContinual = true;
 	u16	efuse_addr = 0;
-	u8 hoffset = 0, hworden = 0;
+	u8 hworden = 0;
 	u8 efuse_data, word_cnts = 0;
 
 	if (bPseudoTest)
@@ -1156,18 +1156,15 @@ static u16 hal_EfuseGetCurrentSize_8188e(struct adapter *pAdapter, bool bPseudoT
 	       AVAILABLE_EFUSE_ADDR(efuse_addr)) {
 		if (efuse_data != 0xFF) {
 			if ((efuse_data & 0x1F) == 0x0F) {		/* extended header */
-				hoffset = efuse_data;
 				efuse_addr++;
 				efuse_OneByteRead(pAdapter, efuse_addr, &efuse_data, bPseudoTest);
 				if ((efuse_data & 0x0F) == 0x0F) {
 					efuse_addr++;
 					continue;
 				} else {
-					hoffset = ((hoffset & 0xE0) >> 5) | ((efuse_data & 0xF0) >> 1);
 					hworden = efuse_data & 0x0F;
 				}
 			} else {
-				hoffset = (efuse_data >> 4) & 0x0F;
 				hworden =  efuse_data & 0x0F;
 			}
 			word_cnts = Efuse_CalculateWordCnts(hworden);
Signature · 1 line
2.32.0

Many thanks Colin, looks good to me.

Regards,
Phil