missing s/dev->priv/netdev_priv(dev) in drivers/net/pcmcia/
Subsystems (2)
PATCH 1/1 missing s/dev->priv/netdev_priv(dev) in drivers/net/pcmcia/
clean up the last two instances of dev->priv in drivers/net/pcmcia. against 2.6.5-rc2-bk.
drivers/net/pcmcia/3c589_cs.c +1 -1
@@ -716,7 +716,7 @@"status %4.4x.\n" , dev->name, (long )skb->len, inw(ioaddr + EL3_STATUS)); - ((struct el3_private *)dev->priv)->stats.tx_bytes += skb->len; + ((struct el3_private *)netdev_priv (dev))->stats.tx_bytes += skb->len;/* Put out the doubleword header... */ outw (skb->len, ioaddr +TX_FIFO );
drivers/net/pcmcia/ibmtr_cs.c +1 -1
@@ -444,7 +444,7 @@ link->state &= ~DEV_PRESENT ;if (link->state &DEV_CONFIG ) {/* set flag to bypass normal interrupt code */ - ((struct tok_info *)dev->priv)->sram_virt |=1 ; + ((struct tok_info *)netdev_priv (dev))->sram_virt |=1 ;netif_device_detach (dev);ibmtr_release (link); }
Quoted 17 lines · Daniel Ritz
clean up the last two instances of
dev->privindrivers/net/pcmcia. against 2.6.5-rc2-bk.drivers/net/pcmcia/3c589_cs.c +1
-1@@ -716,7 +716,7 @@"status %4.4x.\n" , dev->name, (long )skb->len, inw(ioaddr + EL3_STATUS)); - ((struct el3_private *)dev->priv)->stats.tx_bytes += skb->len; + ((struct el3_private *)netdev_priv (dev))->stats.tx_bytes += skb->len;/* Put out the doubleword header... */ outw (skb->len, ioaddr +TX_FIFO );
drivers/net/pcmcia/ibmtr_cs.c line 449
Quoted 7 lines
drivers/net/pcmcia/ibmtr_cs.c +1
-1@@ -444,7 +444,7 @@ link->state &= ~DEV_PRESENT ;if (link->state &DEV_CONFIG ) {/* set flag to bypass normal interrupt code */ - ((struct tok_info *)dev->priv)->sram_virt |=1 ; + ((struct tok_info *)netdev_priv (dev))->sram_virt |=1 ;netif_device_detach (dev);ibmtr_release (link);
although the patch is OK, the code itself is a bit yucky.
Can you please create a temporary variable, of struct el3_private or tok_info type, and eliminate that cast?
struct el3_private *priv = netdev_priv(dev);priv->stats.tx_bytes += skb->len;
Much nicer :)
Jeff
Quoted 29 lines · Jeff Garzik
Quoted 17 lines · Daniel Ritz
clean up the last two instances of
dev->privindrivers/net/pcmcia. against 2.6.5-rc2-bk.drivers/net/pcmcia/3c589_cs.c +1
-1@@ -716,7 +716,7 @@"status %4.4x.\n" , dev->name, (long )skb->len, inw(ioaddr + EL3_STATUS)); - ((struct el3_private *)dev->priv)->stats.tx_bytes += skb->len; + ((struct el3_private *)netdev_priv (dev))->stats.tx_bytes += skb->len;/* Put out the doubleword header... */ outw (skb->len, ioaddr +TX_FIFO );drivers/net/pcmcia/ibmtr_cs.c line 449
Quoted 7 lines
drivers/net/pcmcia/ibmtr_cs.c +1
-1@@ -444,7 +444,7 @@ link->state &= ~DEV_PRESENT ;if (link->state &DEV_CONFIG ) {/* set flag to bypass normal interrupt code */ - ((struct tok_info *)dev->priv)->sram_virt |=1 ; + ((struct tok_info *)netdev_priv (dev))->sram_virt |=1 ;netif_device_detach (dev);ibmtr_release (link);although the patch is OK, the code itself is a bit yucky.
Quoted 8 lines
Can you please create a temporary variable, of struct
el3_privateortok_infotype, and eliminate that cast?struct
el3_private*priv =netdev_priv(dev);priv->stats.tx_bytes+=skb->len;Much nicer :)
agreed. here we go...
drivers/net/pcmcia/3c589_cs.c +2 -1
@@ -711,12 +711,13 @@static int el3_start_xmit (struct sk_buff *skb,struct net_device *dev) {ioaddr_t ioaddr = dev->base_addr; +struct el3_private *priv =netdev_priv (dev);DEBUG (3 ,"%s: el3_start_xmit(length = %ld) called, " "status %4.4x.\n" , dev->name, (long )skb->len,inw (ioaddr +EL3_STATUS )); - ((struct el3_private *)dev->priv)->stats.tx_bytes += skb->len; + priv->stats.tx_bytes += skb->len;/* Put out the doubleword header... */ outw (skb->len, ioaddr +TX_FIFO );
drivers/net/pcmcia/ibmtr_cs.c +2 -1
@@ -444,7 +444,8 @@ link->state &= ~DEV_PRESENT ;if (link->state &DEV_CONFIG ) {/* set flag to bypass normal interrupt code */ - ((struct tok_info *)dev->priv)->sram_virt |=1 ; +struct tok_info *priv =netdev_priv (dev); + priv->sram_virt |=1 ;netif_device_detach (dev);ibmtr_release (link); }
Jeff Garzik
AppliedQuoted 63 lines · Daniel Ritz
Quoted 30 lines · Jeff Garzik
Quoted 17 lines · Daniel Ritz
clean up the last two instances of
dev->privindrivers/net/pcmcia. against 2.6.5-rc2-bk.drivers/net/pcmcia/3c589_cs.c +1
-1@@ -716,7 +716,7 @@"status %4.4x.\n" , dev->name, (long )skb->len, inw(ioaddr + EL3_STATUS)); - ((struct el3_private *)dev->priv)->stats.tx_bytes += skb->len; + ((struct el3_private *)netdev_priv (dev))->stats.tx_bytes += skb->len;/* Put out the doubleword header... */ outw (skb->len, ioaddr +TX_FIFO );drivers/net/pcmcia/ibmtr_cs.c line 449
Quoted 7 lines
drivers/net/pcmcia/ibmtr_cs.c +1
-1@@ -444,7 +444,7 @@ link->state &= ~DEV_PRESENT ;if (link->state &DEV_CONFIG ) {/* set flag to bypass normal interrupt code */ - ((struct tok_info *)dev->priv)->sram_virt |=1 ; + ((struct tok_info *)netdev_priv (dev))->sram_virt |=1 ;netif_device_detach (dev);ibmtr_release (link);although the patch is OK, the code itself is a bit yucky.
Quoted 7 lines
Can you please create a temporary variable, of struct
el3_privateortok_infotype, and eliminate that cast?struct
el3_private*priv =netdev_priv(dev);priv->stats.tx_bytes+=skb->len;Much nicer :)
agreed. here we go...
drivers/net/pcmcia/3c589_cs.c +2
-1@@ -711,12 +711,13 @@static int el3_start_xmit (struct sk_buff *skb,struct net_device *dev) {ioaddr_t ioaddr = dev->base_addr; +struct el3_private *priv =netdev_priv (dev);DEBUG (3 ,"%s: el3_start_xmit(length = %ld) called, " "status %4.4x.\n" , dev->name, (long )skb->len,inw (ioaddr +EL3_STATUS )); - ((struct el3_private *)dev->priv)->stats.tx_bytes += skb->len; + priv->stats.tx_bytes += skb->len;/* Put out the doubleword header... */ outw (skb->len, ioaddr +TX_FIFO );
drivers/net/pcmcia/ibmtr_cs.c line 451
Quoted 9 lines
drivers/net/pcmcia/ibmtr_cs.c +2
-1@@ -444,7 +444,8 @@ link->state &= ~DEV_PRESENT ;if (link->state &DEV_CONFIG ) {/* set flag to bypass normal interrupt code */ - ((struct tok_info *)dev->priv)->sram_virt |=1 ; +struct tok_info *priv =netdev_priv (dev); + priv->sram_virt |=1 ;netif_device_detach (dev);ibmtr_release (link); }
applied to 2.6