Use netdev_feature_xxx helpers to replace the logical operation for netdev features.
Signed-off-by: Jian Shen shenjian15@huawei.com --- drivers/scsi/fcoe/fcoe.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 5ae6c207d3ac..a0e91043368e 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -652,19 +652,19 @@ static void fcoe_netdev_features_change(struct fc_lport *lport, { mutex_lock(&lport->lp_mutex);
- if (netdev->features & NETIF_F_SG) + if (netdev_feature_test_bit(NETIF_F_SG_BIT, netdev->features)) lport->sg_supp = 1; else lport->sg_supp = 0;
- if (netdev->features & NETIF_F_FCOE_CRC) { + if (netdev_feature_test_bit(NETIF_F_FCOE_CRC_BIT, netdev->features)) { lport->crc_offload = 1; FCOE_NETDEV_DBG(netdev, "Supports FCCRC offload\n"); } else { lport->crc_offload = 0; }
- if (netdev->features & NETIF_F_FSO) { + if (netdev_feature_test_bit(NETIF_F_FSO_BIT, netdev->features)) { lport->seq_offload = 1; lport->lso_max = netdev->gso_max_size; FCOE_NETDEV_DBG(netdev, "Supports LSO for max len 0x%x\n", @@ -721,7 +721,7 @@ static int fcoe_netdev_config(struct fc_lport *lport, struct net_device *netdev) * will return 0, so do this first. */ mfs = netdev->mtu; - if (netdev->features & NETIF_F_FCOE_MTU) { + if (netdev_feature_test_bit(NETIF_F_FCOE_MTU_BIT, netdev->features)) { mfs = FCOE_MTU; FCOE_NETDEV_DBG(netdev, "Supports FCOE_MTU of %d bytes\n", mfs); } @@ -1549,7 +1549,8 @@ static int fcoe_xmit(struct fc_lport *lport, struct fc_frame *fp) skb->priority = fcoe->priority;
if (is_vlan_dev(fcoe->netdev) && - fcoe->realdev->features & NETIF_F_HW_VLAN_CTAG_TX) { + netdev_feature_test_bit(NETIF_F_HW_VLAN_CTAG_TX_BIT, + fcoe->realdev->features)) { /* must set skb->dev before calling vlan_put_tag */ skb->dev = fcoe->realdev; __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), @@ -1872,7 +1873,8 @@ static int fcoe_device_notification(struct notifier_block *notifier, case NETDEV_CHANGE: break; case NETDEV_CHANGEMTU: - if (netdev->features & NETIF_F_FCOE_MTU) + if (netdev_feature_test_bit(NETIF_F_FCOE_MTU_BIT, + netdev->features)) break; mfs = netdev->mtu - (sizeof(struct fcoe_hdr) + sizeof(struct fcoe_crc_eof));