--- initial
+++ final
@@ -1,85 +1,82 @@
 static int pasemi_mac_open(struct net_device *dev) {
   struct pasemi_mac *mac = netdev_priv(dev);
   unsigned int flags;
   int i, ret;
   flags = PAS_MAC_CFG_TXP_FCE | PAS_MAC_CFG_TXP_FPC(3) | PAS_MAC_CFG_TXP_SL(3) | PAS_MAC_CFG_TXP_COB(0xf) | PAS_MAC_CFG_TXP_TIFT(8) | PAS_MAC_CFG_TXP_TIFG(12);
   write_mac_reg(mac, PAS_MAC_CFG_TXP, flags);
   ret = pasemi_mac_setup_rx_resources(dev);
   if (ret) goto out_rx_resources;
   mac->tx = pasemi_mac_setup_tx_resources(dev);
   if (!mac->tx) goto out_tx_ring;
   /* We might already have allocated rings in case mtu was changed
    * before interface was brought up.
    */
   if (dev->mtu > 1500 && !mac->num_cs) {
     pasemi_mac_setup_csrings(mac);
     if (!mac->num_cs) goto out_tx_ring;
   }
   /* Zero out rmon counters */
   for (i = 0; i < 32; i++)
     write_mac_reg(mac, PAS_MAC_RMON(i), 0);
   /* 0x3ff with 33MHz clock is about 31us */
   write_iob_reg(PAS_IOB_DMA_COM_TIMEOUTCFG, PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT(0x3ff));
   write_iob_reg(PAS_IOB_DMA_RXCH_CFG(mac->rx->chan.chno), PAS_IOB_DMA_RXCH_CFG_CNTTH(256));
   write_iob_reg(PAS_IOB_DMA_TXCH_CFG(mac->tx->chan.chno), PAS_IOB_DMA_TXCH_CFG_CNTTH(32));
   write_mac_reg(mac, PAS_MAC_IPC_CHNL, PAS_MAC_IPC_CHNL_DCHNO(mac->rx->chan.chno) | PAS_MAC_IPC_CHNL_BCH(mac->rx->chan.chno));
   /* enable rx if */
   write_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if), PAS_DMA_RXINT_RCMDSTA_EN | PAS_DMA_RXINT_RCMDSTA_DROPS_M | PAS_DMA_RXINT_RCMDSTA_BP | PAS_DMA_RXINT_RCMDSTA_OO | PAS_DMA_RXINT_RCMDSTA_BT);
   /* enable rx channel */
   pasemi_dma_start_chan(&rx_ring(mac)->chan, PAS_DMA_RXCHAN_CCMDSTA_DU | PAS_DMA_RXCHAN_CCMDSTA_OD | PAS_DMA_RXCHAN_CCMDSTA_FD | PAS_DMA_RXCHAN_CCMDSTA_DT);
   /* enable tx channel */
   pasemi_dma_start_chan(&tx_ring(mac)->chan, PAS_DMA_TXCHAN_TCMDSTA_SZ | PAS_DMA_TXCHAN_TCMDSTA_DB | PAS_DMA_TXCHAN_TCMDSTA_DE | PAS_DMA_TXCHAN_TCMDSTA_DA);
   pasemi_mac_replenish_rx_ring(dev, RX_RING_SIZE);
   write_dma_reg(PAS_DMA_RXCHAN_INCR(rx_ring(mac)->chan.chno), RX_RING_SIZE >> 1);
   /* Clear out any residual packet count state from firmware */
   pasemi_mac_restart_rx_intr(mac);
   pasemi_mac_restart_tx_intr(mac);
   flags = PAS_MAC_CFG_PCFG_S1 | PAS_MAC_CFG_PCFG_PR | PAS_MAC_CFG_PCFG_CE;
   if (mac->type == MAC_TYPE_GMAC)
     flags |= PAS_MAC_CFG_PCFG_TSR_1G | PAS_MAC_CFG_PCFG_SPD_1G;
   else
     flags |= PAS_MAC_CFG_PCFG_TSR_10G | PAS_MAC_CFG_PCFG_SPD_10G;
   /* Enable interface in MAC */
   write_mac_reg(mac, PAS_MAC_CFG_PCFG, flags);
   ret = pasemi_mac_phy_init(dev);
   if (ret) {
     /* Since we won't get link notification, just enable RX */
     pasemi_mac_intf_enable(mac);
     if (mac->type == MAC_TYPE_GMAC) {
       /* Warn for missing PHY on SGMII (1Gig) ports */
       dev_warn(&mac->pdev->dev, "PHY init failed: %d.\n", ret);
       dev_warn(&mac->pdev->dev, "Defaulting to 1Gbit full duplex\n");
     }
   }
   netif_start_queue(dev);
   napi_enable(&mac->napi);
   snprintf(mac->tx_irq_name, sizeof(mac->tx_irq_name), "%s tx", dev->name);
   ret = request_irq(mac->tx->chan.irq, pasemi_mac_tx_intr, 0, mac->tx_irq_name, mac->tx);
   if (ret) {
     dev_err(&mac->pdev->dev, "request_irq of irq %d failed: %d\n", mac->tx->chan.irq, ret);
     goto out_tx_int;
   }
   snprintf(mac->rx_irq_name, sizeof(mac->rx_irq_name), "%s rx", dev->name);
   ret = request_irq(mac->rx->chan.irq, pasemi_mac_rx_intr, 0, mac->rx_irq_name, mac->rx);
   if (ret) {
     dev_err(&mac->pdev->dev, "request_irq of irq %d failed: %d\n", mac->rx->chan.irq, ret);
     goto out_rx_int;
   }
   if (mac->phydev) phy_start(mac->phydev);
-  init_timer(&mac->tx->clean_timer);
-  mac->tx->clean_timer.function = pasemi_mac_tx_timer;
-  mac->tx->clean_timer.data = (unsigned long)mac->tx;
-  mac->tx->clean_timer.expires = jiffies + HZ;
-  add_timer(&mac->tx->clean_timer);
+  setup_timer(&mac->tx->clean_timer, pasemi_mac_tx_timer, (unsigned long)mac->tx);
+  mod_timer(&mac->tx->clean_timer, jiffies + HZ);
   return 0;
 out_rx_int:
   free_irq(mac->tx->chan.irq, mac->tx);
 out_tx_int:
   napi_disable(&mac->napi);
   netif_stop_queue(dev);
 out_tx_ring:
   if (mac->tx) pasemi_mac_free_tx_resources(mac);
   pasemi_mac_free_rx_resources(mac);
 out_rx_resources:
   return ret;
 }<sep>@@
expression E0;
expression E1;
expression E2,e2;
@@
- init_timer(&E0);
+ setup_timer(&E0, E1, E2);
  ... when != E0.data = e2;
- E0.function = E1;
  ... when != init_timer(&E0);
- E0.data = E2;



@@
expression E0,v;
@@

-	E0.expires = v;
	...
-	add_timer(&E0);
+	mod_timer(&E0, v);