Commit 3c5a7b75479bb476bb4ed298537ad48a2a23b79d

Authored by Marek Vasut
Committed by Marek Vasut
1 parent 02b0895c21

net: sh_eth: Zap port variable

Inline this variable which is quite useless.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Joe Hershberger <joe.hershberger@ni.com>

Showing 1 changed file with 16 additions and 18 deletions Side-by-side Diff

drivers/net/sh_eth.c
... ... @@ -63,8 +63,8 @@
63 63  
64 64 static int sh_eth_send_common(struct sh_eth_dev *eth, void *packet, int len)
65 65 {
66   - int port = eth->port, ret = 0, timeout;
67   - struct sh_eth_info *port_info = &eth->port_info[port];
  66 + int ret = 0, timeout;
  67 + struct sh_eth_info *port_info = &eth->port_info[eth->port];
68 68  
69 69 if (!packet || len > 0xffff) {
70 70 printf(SHETHER_NAME ": %s: Invalid argument\n", __func__);
... ... @@ -120,8 +120,8 @@
120 120  
121 121 static int sh_eth_recv_start(struct sh_eth_dev *eth)
122 122 {
123   - int port = eth->port, len = 0;
124   - struct sh_eth_info *port_info = &eth->port_info[port];
  123 + int len = 0;
  124 + struct sh_eth_info *port_info = &eth->port_info[eth->port];
125 125  
126 126 /* Check if the rx descriptor is ready */
127 127 invalidate_cache(port_info->rx_desc_cur, sizeof(struct rx_desc_s));
128 128  
... ... @@ -192,9 +192,9 @@
192 192  
193 193 static int sh_eth_tx_desc_init(struct sh_eth_dev *eth)
194 194 {
195   - int port = eth->port, i, ret = 0;
  195 + int i, ret = 0;
196 196 u32 alloc_desc_size = NUM_TX_DESC * sizeof(struct tx_desc_s);
197   - struct sh_eth_info *port_info = &eth->port_info[port];
  197 + struct sh_eth_info *port_info = &eth->port_info[eth->port];
198 198 struct tx_desc_s *cur_tx_desc;
199 199  
200 200 /*
201 201  
... ... @@ -245,9 +245,9 @@
245 245  
246 246 static int sh_eth_rx_desc_init(struct sh_eth_dev *eth)
247 247 {
248   - int port = eth->port, i, ret = 0;
  248 + int i, ret = 0;
249 249 u32 alloc_desc_size = NUM_RX_DESC * sizeof(struct rx_desc_s);
250   - struct sh_eth_info *port_info = &eth->port_info[port];
  250 + struct sh_eth_info *port_info = &eth->port_info[eth->port];
251 251 struct rx_desc_s *cur_rx_desc;
252 252 u8 *rx_buf;
253 253  
... ... @@ -318,8 +318,7 @@
318 318  
319 319 static void sh_eth_tx_desc_free(struct sh_eth_dev *eth)
320 320 {
321   - int port = eth->port;
322   - struct sh_eth_info *port_info = &eth->port_info[port];
  321 + struct sh_eth_info *port_info = &eth->port_info[eth->port];
323 322  
324 323 if (port_info->tx_desc_alloc) {
325 324 free(port_info->tx_desc_alloc);
... ... @@ -329,8 +328,7 @@
329 328  
330 329 static void sh_eth_rx_desc_free(struct sh_eth_dev *eth)
331 330 {
332   - int port = eth->port;
333   - struct sh_eth_info *port_info = &eth->port_info[port];
  331 + struct sh_eth_info *port_info = &eth->port_info[eth->port];
334 332  
335 333 if (port_info->rx_desc_alloc) {
336 334 free(port_info->rx_desc_alloc);
... ... @@ -522,8 +520,8 @@
522 520 #ifndef CONFIG_DM_ETH
523 521 static int sh_eth_phy_config_legacy(struct sh_eth_dev *eth)
524 522 {
525   - int port = eth->port, ret = 0;
526   - struct sh_eth_info *port_info = &eth->port_info[port];
  523 + int ret = 0;
  524 + struct sh_eth_info *port_info = &eth->port_info[eth->port];
527 525 struct eth_device *dev = port_info->dev;
528 526 struct phy_device *phydev;
529 527  
... ... @@ -545,8 +543,8 @@
545 543  
546 544 static int sh_eth_recv_common(struct sh_eth_dev *eth)
547 545 {
548   - int port = eth->port, len = 0;
549   - struct sh_eth_info *port_info = &eth->port_info[port];
  546 + int len = 0;
  547 + struct sh_eth_info *port_info = &eth->port_info[eth->port];
550 548 uchar *packet = (uchar *)ADDR_TO_P2(port_info->rx_desc_cur->rd2);
551 549  
552 550 len = sh_eth_recv_start(eth);
... ... @@ -750,8 +748,8 @@
750 748 struct sh_ether_priv *priv = dev_get_priv(dev);
751 749 struct eth_pdata *pdata = dev_get_platdata(dev);
752 750 struct sh_eth_dev *eth = &priv->shdev;
753   - int port = eth->port, ret = 0;
754   - struct sh_eth_info *port_info = &eth->port_info[port];
  751 + int ret = 0;
  752 + struct sh_eth_info *port_info = &eth->port_info[eth->port];
755 753 struct phy_device *phydev;
756 754 int mask = 0xffffffff;
757 755