net: remove redundant code
authorEric Dumazet <eric.dumazet@gmail.com>
Tue, 30 Mar 2010 05:02:15 +0000 (05:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Mar 2010 06:51:10 +0000 (23:51 -0700)
eth_type_trans(skb, netdev) does the "skb->dev = netdev;"
initialization, we can remove it from various network drivers.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 files changed:
drivers/net/arm/w90p910_ether.c
drivers/net/atl1c/atl1c_main.c
drivers/net/atl1e/atl1e_main.c
drivers/net/atlx/atl2.c
drivers/net/bcm63xx_enet.c
drivers/net/benet/be_main.c
drivers/net/fec_mpc52xx.c
drivers/net/greth.c
drivers/net/ibm_newemac/core.c
drivers/net/ks8851_mll.c
drivers/net/ksz884x.c
drivers/net/s6gmac.c
drivers/net/tehuti.c
drivers/net/xilinx_emaclite.c

index febd813c916d06474b05b55b861b0f136f19dacc..3302df21d591e6d1f2d06084cf1164a60b858456 100644 (file)
@@ -743,7 +743,6 @@ static void netdev_rx(struct net_device *dev)
                                return;
                        }
 
-                       skb->dev = dev;
                        skb_reserve(skb, 2);
                        skb_put(skb, length);
                        skb_copy_to_linear_data(skb, data, length);
index 50dc531a02d83be01f0238c2106d246bee449cd9..a5508e1b261b9cc3c14c2be7dcc4d74f8ed41810 100644 (file)
@@ -1817,7 +1817,6 @@ rrs_checked:
                atl1c_clean_rfd(rfd_ring, rrs, rfd_num);
                skb_put(skb, length - ETH_FCS_LEN);
                skb->protocol = eth_type_trans(skb, netdev);
-               skb->dev = netdev;
                atl1c_rx_checksum(adapter, skb, rrs);
                if (unlikely(adapter->vlgrp) && rrs->word3 & RRS_VLAN_INS) {
                        u16 vlan;
index 73302ae468aad56d862f6fc58f954b49475c0d58..7231b57791224b9950d4c8dea802641ad99db49e 100644 (file)
@@ -1428,7 +1428,6 @@ static void atl1e_clean_rx_irq(struct atl1e_adapter *adapter, u8 que,
                                            "Memory squeeze, deferring packet\n");
                                goto skip_pkt;
                        }
-                       skb->dev = netdev;
                        memcpy(skb->data, (u8 *)(prrs + 1), packet_size);
                        skb_put(skb, packet_size);
                        skb->protocol = eth_type_trans(skb, netdev);
index 7061d7108f08b8cc6e1e1a293a63c93718319f4f..199f2c9ce7496fd7a07870c5b998adc70ec9b289 100644 (file)
@@ -421,7 +421,6 @@ static void atl2_intr_rx(struct atl2_adapter *adapter)
                                netdev->stats.rx_dropped++;
                                break;
                        }
-                       skb->dev = netdev;
                        memcpy(skb->data, rxd->packet, rx_size);
                        skb_put(skb, rx_size);
                        skb->protocol = eth_type_trans(skb, netdev);
index 8cdcab7655c0751c70aaf93b74ca48982b4f3936..37eb8021de1c6b0d563cf8e7dc532dba0b89e7d3 100644 (file)
@@ -340,7 +340,6 @@ static int bcm_enet_receive_queue(struct net_device *dev, int budget)
                }
 
                skb_put(skb, len);
-               skb->dev = dev;
                skb->protocol = eth_type_trans(skb, dev);
                priv->stats.rx_packets++;
                priv->stats.rx_bytes += len;
index 50ea0561ecc7ab30377dac45713dc0fcd323b48a..17282df6e2023a84096a5c74e1c8c70c655e3351 100644 (file)
@@ -826,7 +826,6 @@ static void be_rx_compl_process(struct be_adapter *adapter,
 
        skb->truesize = skb->len + sizeof(struct sk_buff);
        skb->protocol = eth_type_trans(skb, adapter->netdev);
-       skb->dev = adapter->netdev;
 
        vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp);
        vtm = AMAP_GET_BITS(struct amap_eth_rx_compl, vtm, rxcp);
index 0dbd7219bbde2fa067134666cab69bc37325a147..704155e2bdd14ffb8e4ee34be5d0f3e143eb1525 100644 (file)
@@ -435,7 +435,6 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
                                 DMA_FROM_DEVICE);
                length = status & BCOM_FEC_RX_BD_LEN_MASK;
                skb_put(rskb, length - 4);      /* length without CRC32 */
-               rskb->dev = dev;
                rskb->protocol = eth_type_trans(rskb, dev);
                netif_rx(rskb);
 
index 2b9c1cbc9ec1b3e33d2275aa1682a78fe7becbf1..c5e0d28a6de9bafcbfc7e057cb6d514f3e113581 100644 (file)
@@ -894,7 +894,6 @@ static int greth_rx_gbit(struct net_device *dev, int limit)
                                else
                                        skb->ip_summed = CHECKSUM_NONE;
 
-                               skb->dev = dev;
                                skb->protocol = eth_type_trans(skb, dev);
                                dev->stats.rx_packets++;
                                netif_receive_skb(skb);
index fb0ac6d7c0400eb6f5034d0b618bbbe9643e918f..d8533a4ef82541f88d65189174f80af56f5417e6 100644 (file)
@@ -1699,7 +1699,6 @@ static int emac_poll_rx(void *param, int budget)
 
                skb_put(skb, len);
        push_packet:
-               skb->dev = dev->ndev;
                skb->protocol = eth_type_trans(skb, dev->ndev);
                emac_rx_csum(dev, skb, ctrl);
 
index d3c6a77f7ec04a8494daba1cafcc6f5c763561ba..ee3fe30b2ad7cc376cc0e409011d40d6105055ae 100644 (file)
@@ -801,7 +801,6 @@ static void ks_rcv(struct ks_net *ks, struct net_device *netdev)
                        /* read data block including CRC 4 bytes */
                        ks_read_qmu(ks, (u16 *)skb->data, frame_hdr->len);
                        skb_put(skb, frame_hdr->len);
-                       skb->dev = netdev;
                        skb->protocol = eth_type_trans(skb, netdev);
                        netif_rx(skb);
                } else {
index b47a2b3e116e6ac9ed452f38b368c34a5e625dfb..b843bf7d8c17477dabb6216dfd390121a83b7c56 100644 (file)
@@ -5043,8 +5043,6 @@ static inline int rx_proc(struct net_device *dev, struct ksz_hw* hw,
                        dma_buf->skb->data, packet_len);
        } while (0);
 
-       skb->dev = dev;
-
        skb->protocol = eth_type_trans(skb, dev);
 
        if (hw->rx_cfg & (DMA_RX_CSUM_UDP | DMA_RX_CSUM_TCP))
index 45f26344b36821ebe619cd30e2b753bce2944f96..6b12524ad7c1d491177c65bf94eecc10d03cd899 100644 (file)
@@ -396,7 +396,6 @@ static void s6gmac_rx_interrupt(struct net_device *dev)
                } else {
                        skb_put(skb, (pfx >> S6_GMAC_BURST_POSTRD_LEN)
                                & S6_GMAC_BURST_POSTRD_LEN_MASK);
-                       skb->dev = dev;
                        skb->protocol = eth_type_trans(skb, dev);
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
                        netif_rx(skb);
index f5493092521acd159f750fe18072aba812dd2816..068a47174fcab0c61ae55703a7d78907251b5335 100644 (file)
@@ -1303,7 +1303,6 @@ static int bdx_rx_receive(struct bdx_priv *priv, struct rxd_fifo *f, int budget)
                priv->net_stats.rx_bytes += len;
 
                skb_put(skb, len);
-               skb->dev = priv->ndev;
                skb->ip_summed = CHECKSUM_UNNECESSARY;
                skb->protocol = eth_type_trans(skb, priv->ndev);
 
index 1a74594224b1b8303c74b4247b444cf251e58119..eaebba8df6fc803011ea6161913099bac233a9cb 100644 (file)
@@ -638,7 +638,6 @@ static void xemaclite_rx_handler(struct net_device *dev)
        }
 
        skb_put(skb, len);      /* Tell the skb how much data we got */
-       skb->dev = dev;         /* Fill out required meta-data */
 
        skb->protocol = eth_type_trans(skb, dev);
        skb->ip_summed = CHECKSUM_NONE;