Use netdev_feature_xxx helpers to replace the logical operation for netdev features.
Signed-off-by: Jian Shen shenjian15@huawei.com --- drivers/net/loopback.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index a1c77cc..23cad64 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c @@ -174,17 +174,15 @@ static void gen_lo_setup(struct net_device *dev, dev->flags = IFF_LOOPBACK; dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE; netif_keep_dst(dev); - dev->hw_features = NETIF_F_GSO_SOFTWARE; - dev->features = NETIF_F_SG | NETIF_F_FRAGLIST - | NETIF_F_GSO_SOFTWARE - | NETIF_F_HW_CSUM - | NETIF_F_RXCSUM - | NETIF_F_SCTP_CRC - | NETIF_F_HIGHDMA - | NETIF_F_LLTX - | NETIF_F_NETNS_LOCAL - | NETIF_F_VLAN_CHALLENGED - | NETIF_F_LOOPBACK; + netdev_feature_zero(&dev->hw_features); + netdev_feature_set_bits(NETIF_F_GSO_SOFTWARE, &dev->hw_features); + netdev_feature_zero(&dev->features); + netdev_feature_set_bits(NETIF_F_SG | NETIF_F_FRAGLIST | + NETIF_F_GSO_SOFTWARE | NETIF_F_HW_CSUM | + NETIF_F_RXCSUM | NETIF_F_SCTP_CRC | + NETIF_F_HIGHDMA | NETIF_F_LLTX | + NETIF_F_NETNS_LOCAL | NETIF_F_VLAN_CHALLENGED | + NETIF_F_LOOPBACK, &dev->hw_features); dev->ethtool_ops = eth_ops; dev->header_ops = hdr_ops; dev->netdev_ops = dev_ops;