Use netdev_feature_xxx helpers to replace the logical operation for netdev features.
Signed-off-by: Jian Shen shenjian15@huawei.com --- arch/um/drivers/vector_kern.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c index cf3e781..f0ad82b 100644 --- a/arch/um/drivers/vector_kern.c +++ b/arch/um/drivers/vector_kern.c @@ -1345,7 +1345,8 @@ static void vector_net_tx_timeout(struct net_device *dev, unsigned int txqueue) static void vector_fix_features(struct net_device *dev, netdev_features_t *features) { - *features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM); + netdev_feature_clear_bits(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM, + &features); }
static int vector_set_features(struct net_device *dev, @@ -1356,7 +1357,7 @@ static int vector_set_features(struct net_device *dev, * no way to negotiate it on raw sockets, so we can change * only our side. */ - if (features & NETIF_F_GRO) + if (netdev_feature_test_bit(NETIF_F_GRO_BIT, features)) /* All new frame buffers will be GRO-sized */ vp->req_size = 65536; else @@ -1626,7 +1627,10 @@ static void vector_eth_configure( .bpf = NULL });
- dev->features = dev->hw_features = (NETIF_F_SG | NETIF_F_FRAGLIST); + netdev_feature_zero(&dev->hw_features); + netdev_feature_set_bits(NETIF_F_SG | NETIF_F_FRAGLIST, + &dev->hw_features); + netdev_feature_copy(&dev->features, dev->hw_features); tasklet_setup(&vp->tx_poll, vector_tx_poll); INIT_WORK(&vp->reset_tx, vector_reset_tx);