diff mbox series

[net-next] net: smsc911x: Remove unused variables

Message ID 1599536965-162578-1-git-send-email-xuwei5@hisilicon.com
State New
Headers show
Series [net-next] net: smsc911x: Remove unused variables | expand

Commit Message

Wei Xu Sept. 8, 2020, 3:49 a.m. UTC
Fixes the following W=1 kernel build warning(s):

 drivers/net/ethernet/smsc/smsc911x.c: In function ‘smsc911x_rx_fastforward’:
 drivers/net/ethernet/smsc/smsc911x.c:1199:16: warning: variable ‘temp’ set but not used [-Wunused-but-set-variable]

 drivers/net/ethernet/smsc/smsc911x.c: In function ‘smsc911x_eeprom_write_location’:
 drivers/net/ethernet/smsc/smsc911x.c:2058:6: warning: variable ‘temp’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Wei Xu <xuwei5@hisilicon.com>

---
 drivers/net/ethernet/smsc/smsc911x.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

-- 
2.8.1

Comments

David Miller Sept. 9, 2020, 2:53 a.m. UTC | #1
From: Wei Xu <xuwei5@hisilicon.com>

Date: Tue, 8 Sep 2020 11:49:25 +0800

> Fixes the following W=1 kernel build warning(s):

> 

>  drivers/net/ethernet/smsc/smsc911x.c: In function ‘smsc911x_rx_fastforward’:

>  drivers/net/ethernet/smsc/smsc911x.c:1199:16: warning: variable ‘temp’ set but not used [-Wunused-but-set-variable]

> 

>  drivers/net/ethernet/smsc/smsc911x.c: In function ‘smsc911x_eeprom_write_location’:

>  drivers/net/ethernet/smsc/smsc911x.c:2058:6: warning: variable ‘temp’ set but not used [-Wunused-but-set-variable]

> 

> Signed-off-by: Wei Xu <xuwei5@hisilicon.com>


Applied, thank you.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index fc168f8..823d9a7 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -1196,9 +1196,8 @@  smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktwords)
 			SMSC_WARN(pdata, hw, "Timed out waiting for "
 				  "RX FFWD to finish, RX_DP_CTRL: 0x%08X", val);
 	} else {
-		unsigned int temp;
 		while (pktwords--)
-			temp = smsc911x_reg_read(pdata, RX_DATA_FIFO);
+			smsc911x_reg_read(pdata, RX_DATA_FIFO);
 	}
 }
 
@@ -2055,7 +2054,6 @@  static int smsc911x_eeprom_write_location(struct smsc911x_data *pdata,
 					  u8 address, u8 data)
 {
 	u32 op = E2P_CMD_EPC_CMD_ERASE_ | address;
-	u32 temp;
 	int ret;
 
 	SMSC_TRACE(pdata, drv, "address 0x%x, data 0x%x", address, data);
@@ -2066,7 +2064,7 @@  static int smsc911x_eeprom_write_location(struct smsc911x_data *pdata,
 		smsc911x_reg_write(pdata, E2P_DATA, (u32)data);
 
 		/* Workaround for hardware read-after-write restriction */
-		temp = smsc911x_reg_read(pdata, BYTE_TEST);
+		smsc911x_reg_read(pdata, BYTE_TEST);
 
 		ret = smsc911x_eeprom_send_cmd(pdata, op);
 	}