Use netdev_feature_xxx helpers to replace the logical operation for netdev features.
Signed-off-by: Jian Shen shenjian15@huawei.com --- drivers/net/ethernet/micrel/ksz884x.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c index a0ee155..18f50360 100644 --- a/drivers/net/ethernet/micrel/ksz884x.c +++ b/drivers/net/ethernet/micrel/ksz884x.c @@ -6504,7 +6504,7 @@ static int netdev_set_features(struct net_device *dev, mutex_lock(&hw_priv->lock);
/* see note in hw_setup() */ - if (features & NETIF_F_RXCSUM) + if (netdev_feature_test_bit(NETIF_F_RXCSUM_BIT, features)) hw->rx_cfg |= DMA_RX_CSUM_TCP | DMA_RX_CSUM_IP; else hw->rx_cfg &= ~(DMA_RX_CSUM_TCP | DMA_RX_CSUM_IP); @@ -6702,15 +6702,17 @@ static int __init netdev_init(struct net_device *dev) /* 500 ms timeout */ dev->watchdog_timeo = HZ / 2;
- dev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_RXCSUM; + netdev_feature_zero(&dev->hw_features); + netdev_feature_set_bits(NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_RXCSUM, + &dev->hw_features);
/* * Hardware does not really support IPv6 checksum generation, but * driver actually runs faster with this on. */ - dev->hw_features |= NETIF_F_IPV6_CSUM; + netdev_feature_set_bits(NETIF_F_IPV6_CSUM_BIT, &dev->hw_features);
- dev->features |= dev->hw_features; + netdev_feature_or(&dev->features, dev->features, dev->hw_features);
sema_init(&priv->proc_sem, 1);