net: fec: Factorize feature setting
authorNimrod Andy <B38611@freescale.com>
Thu, 12 Jun 2014 00:16:20 +0000 (08:16 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Jun 2014 18:01:57 +0000 (11:01 -0700)
In order to enhance the code readable, let's factorize the
feature list.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c

index 55b55d2f73bc3497e5437033c1988e3762a19357..f943cd142ef739096c615e1c3f0afff106d6ba4c 100644 (file)
@@ -2087,21 +2087,19 @@ static int fec_enet_init(struct net_device *ndev)
        writel(FEC_RX_DISABLED_IMASK, fep->hwp + FEC_IMASK);
        netif_napi_add(ndev, &fep->napi, fec_enet_rx_napi, NAPI_POLL_WEIGHT);
 
-       if (id_entry->driver_data & FEC_QUIRK_HAS_VLAN) {
+       if (id_entry->driver_data & FEC_QUIRK_HAS_VLAN)
                /* enable hw VLAN support */
                ndev->features |= NETIF_F_HW_VLAN_CTAG_RX;
-               ndev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX;
-       }
 
        if (id_entry->driver_data & FEC_QUIRK_HAS_CSUM) {
                /* enable hw accelerator */
                ndev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
                                | NETIF_F_RXCSUM);
-               ndev->hw_features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
-                               | NETIF_F_RXCSUM);
                fep->csum_flags |= FLAG_RX_CSUM_ENABLED;
        }
 
+       ndev->hw_features = ndev->features;
+
        fec_restart(ndev, 0);
 
        return 0;