net: spread __net_init, __net_exit
[safe/jmp/linux-2.6] / drivers / net / jme.c
index 29cd5f4..26eed49 100644 (file)
@@ -880,27 +880,27 @@ jme_rxsum_ok(struct jme_adapter *jme, u16 flags)
        if (!(flags & (RXWBFLAG_TCPON | RXWBFLAG_UDPON | RXWBFLAG_IPV4)))
                return false;
 
-       if (unlikely(!(flags & RXWBFLAG_MF) &&
-       (flags & RXWBFLAG_TCPON) && !(flags & RXWBFLAG_TCPCS))) {
-               msg_rx_err(jme, "TCP Checksum error.\n");
-               goto out_sumerr;
+       if (unlikely((flags & (RXWBFLAG_MF | RXWBFLAG_TCPON | RXWBFLAG_TCPCS))
+                       == RXWBFLAG_TCPON)) {
+               if (flags & RXWBFLAG_IPV4)
+                       msg_rx_err(jme, "TCP Checksum error\n");
+               return false;
        }
 
-       if (unlikely(!(flags & RXWBFLAG_MF) &&
-       (flags & RXWBFLAG_UDPON) && !(flags & RXWBFLAG_UDPCS))) {
-               msg_rx_err(jme, "UDP Checksum error.\n");
-               goto out_sumerr;
+       if (unlikely((flags & (RXWBFLAG_MF | RXWBFLAG_UDPON | RXWBFLAG_UDPCS))
+                       == RXWBFLAG_UDPON)) {
+               if (flags & RXWBFLAG_IPV4)
+                       msg_rx_err(jme, "UDP Checksum error.\n");
+               return false;
        }
 
-       if (unlikely((flags & RXWBFLAG_IPV4) && !(flags & RXWBFLAG_IPCS))) {
+       if (unlikely((flags & (RXWBFLAG_IPV4 | RXWBFLAG_IPCS))
+                       == RXWBFLAG_IPV4)) {
                msg_rx_err(jme, "IPv4 Checksum error.\n");
-               goto out_sumerr;
+               return false;
        }
 
        return true;
-
-out_sumerr:
-       return false;
 }
 
 static void
@@ -1050,8 +1050,8 @@ jme_dynamic_pcc(struct jme_adapter *jme)
 
        if ((NET_STAT(jme).rx_bytes - dpi->last_bytes) > PCC_P3_THRESHOLD)
                jme_attempt_pcc(dpi, PCC_P3);
-       else if ((NET_STAT(jme).rx_packets - dpi->last_pkts) > PCC_P2_THRESHOLD
-       || dpi->intr_cnt > PCC_INTR_THRESHOLD)
+       else if ((NET_STAT(jme).rx_packets - dpi->last_pkts) > PCC_P2_THRESHOLD ||
+                dpi->intr_cnt > PCC_INTR_THRESHOLD)
                jme_attempt_pcc(dpi, PCC_P2);
        else
                jme_attempt_pcc(dpi, PCC_P1);
@@ -1931,7 +1931,7 @@ jme_stop_queue_if_full(struct jme_adapter *jme)
  * This function is already protected by netif_tx_lock()
  */
 
-static int
+static netdev_tx_t
 jme_start_xmit(struct sk_buff *skb, struct net_device *netdev)
 {
        struct jme_adapter *jme = netdev_priv(netdev);
@@ -2199,8 +2199,8 @@ jme_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ecmd)
        if (netif_running(netdev))
                return -EBUSY;
 
-       if (ecmd->use_adaptive_rx_coalesce
-       && test_bit(JME_FLAG_POLL, &jme->flags)) {
+       if (ecmd->use_adaptive_rx_coalesce &&
+           test_bit(JME_FLAG_POLL, &jme->flags)) {
                clear_bit(JME_FLAG_POLL, &jme->flags);
                jme->jme_rx = netif_rx;
                jme->jme_vlan_rx = vlan_hwaccel_rx;
@@ -2209,8 +2209,8 @@ jme_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ecmd)
                dpi->cnt                = 0;
                jme_set_rx_pcc(jme, PCC_P1);
                jme_interrupt_mode(jme);
-       } else if (!(ecmd->use_adaptive_rx_coalesce)
-       && !(test_bit(JME_FLAG_POLL, &jme->flags))) {
+       } else if (!(ecmd->use_adaptive_rx_coalesce) &&
+                  !(test_bit(JME_FLAG_POLL, &jme->flags))) {
                set_bit(JME_FLAG_POLL, &jme->flags);
                jme->jme_rx = netif_receive_skb;
                jme->jme_vlan_rx = vlan_hwaccel_receive_skb;
@@ -2764,19 +2764,19 @@ jme_init_one(struct pci_dev *pdev,
        atomic_set(&jme->rx_empty, 1);
 
        tasklet_init(&jme->pcc_task,
-                    &jme_pcc_tasklet,
+                    jme_pcc_tasklet,
                     (unsigned long) jme);
        tasklet_init(&jme->linkch_task,
-                    &jme_link_change_tasklet,
+                    jme_link_change_tasklet,
                     (unsigned long) jme);
        tasklet_init(&jme->txclean_task,
-                    &jme_tx_clean_tasklet,
+                    jme_tx_clean_tasklet,
                     (unsigned long) jme);
        tasklet_init(&jme->rxclean_task,
-                    &jme_rx_clean_tasklet,
+                    jme_rx_clean_tasklet,
                     (unsigned long) jme);
        tasklet_init(&jme->rxempty_task,
-                    &jme_rx_empty_tasklet,
+                    jme_rx_empty_tasklet,
                     (unsigned long) jme);
        tasklet_disable_nosync(&jme->linkch_task);
        tasklet_disable_nosync(&jme->txclean_task);
@@ -2994,7 +2994,7 @@ jme_resume(struct pci_dev *pdev)
 }
 #endif
 
-static struct pci_device_id jme_pci_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(jme_pci_tbl) = {
        { PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMC250) },
        { PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMC260) },
        { }