LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] staging: r8188eu: remove redundant variable hoffset
@ 2021-09-07  8:53 Colin King
  2021-09-07 22:10 ` Phillip Potter
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-09-07  8:53 UTC (permalink / raw)
  To: Larry Finger, Phillip Potter, Greg Kroah-Hartman, linux-staging
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
index 14758361960c..7c12ca548c47 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
@@ -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);
-- 
2.32.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: r8188eu: remove redundant variable hoffset
  2021-09-07  8:53 [PATCH] staging: r8188eu: remove redundant variable hoffset Colin King
@ 2021-09-07 22:10 ` Phillip Potter
  0 siblings, 0 replies; 2+ messages in thread
From: Phillip Potter @ 2021-09-07 22:10 UTC (permalink / raw)
  To: Colin King
  Cc: Larry Finger, Greg Kroah-Hartman, linux-staging, kernel-janitors,
	linux-kernel

On Tue, Sep 07, 2021 at 09:53:02AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable hoffset is being assigned values but it is never being
> used. The variable is redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> index 14758361960c..7c12ca548c47 100644
> --- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> +++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> @@ -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);
> -- 
> 2.32.0
> 

Many thanks Colin, looks good to me.

Acked-by: Phillip Potter <phil@philpotter.co.uk>

Regards,
Phil

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-07 22:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07  8:53 [PATCH] staging: r8188eu: remove redundant variable hoffset Colin King
2021-09-07 22:10 ` Phillip Potter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).