
Use netdev_feature_xxx helpers to replace the logical operation for netdev features. Signed-off-by: Jian Shen <shenjian15@huawei.com> --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 488d50a..5fd0b7a 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -220,7 +220,8 @@ static void ipoib_fix_features(struct net_device *dev, struct ipoib_dev_priv *priv = ipoib_priv(dev); if (test_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags)) - *features &= ~(NETIF_F_IP_CSUM | NETIF_F_TSO); + netdev_feature_clear_bits(NETIF_F_IP_CSUM | NETIF_F_TSO, + features); } static int ipoib_change_mtu(struct net_device *dev, int new_mtu) @@ -1849,12 +1850,15 @@ static void ipoib_set_dev_features(struct ipoib_dev_priv *priv) priv->hca_caps = priv->ca->attrs.device_cap_flags; if (priv->hca_caps & IB_DEVICE_UD_IP_CSUM) { - priv->dev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_RXCSUM; + netdev_feature_set_bits(NETIF_F_IP_CSUM | NETIF_F_RXCSUM, + &priv->dev->hw_features); if (priv->hca_caps & IB_DEVICE_UD_TSO) - priv->dev->hw_features |= NETIF_F_TSO; + netdev_feature_set_bit(NETIF_F_TSO_BIT, + &priv->dev->hw_features); - priv->dev->features |= priv->dev->hw_features; + netdev_feature_or(&priv->dev->features, priv->dev->features, + priv->dev->hw_features); } } @@ -2117,8 +2121,8 @@ void ipoib_setup_common(struct net_device *dev) dev->addr_len = INFINIBAND_ALEN; dev->type = ARPHRD_INFINIBAND; dev->tx_queue_len = ipoib_sendq_size * 2; - dev->features = (NETIF_F_VLAN_CHALLENGED | - NETIF_F_HIGHDMA); + netdev_feature_set_bits(NETIF_F_VLAN_CHALLENGED | + NETIF_F_HIGHDMA, &dev->features); netif_keep_dst(dev); memcpy(dev->broadcast, ipv4_bcast_addr, INFINIBAND_ALEN); -- 2.8.1