be2net: use be_virtfn() instead of !be_physfn()
authorKalesh AP <kalesh.purayil@emulex.com>
Wed, 6 May 2015 09:30:38 +0000 (05:30 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sat, 9 May 2015 20:27:04 +0000 (16:27 -0400)
Use be_virtfn() to determine a VF instead of !be_physfn() for better
readability.

Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_cmds.c
drivers/net/ethernet/emulex/benet/be_main.c

index 095b1dcd55ea607ba86729db8b93b19e25145168..f03ec2dcc971f6b102210c1ee9ec061361613af9 100644 (file)
@@ -1458,7 +1458,7 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags,
                *if_handle = le32_to_cpu(resp->interface_id);
 
                /* Hack to retrieve VF's pmac-id on BE3 */
-               if (BE3_chip(adapter) && !be_physfn(adapter))
+               if (BE3_chip(adapter) && be_virtfn(adapter))
                        adapter->pmac_id[0] = le32_to_cpu(resp->pmac_id);
        }
        return status;
@@ -3271,7 +3271,7 @@ static bool be_is_wol_excluded(struct be_adapter *adapter)
 {
        struct pci_dev *pdev = adapter->pdev;
 
-       if (!be_physfn(adapter))
+       if (be_virtfn(adapter))
                return true;
 
        switch (pdev->subsystem_device) {
index e0ca333f95d3ba7274d555e524a5c8486597d451..229134bda0bd18d7b473959490ac1ac514097659 100644 (file)
@@ -3112,7 +3112,7 @@ fail:
        dev_warn(dev, "MSIx enable failed\n");
 
        /* INTx is not supported in VFs, so fail probe if enable_msix fails */
-       if (!be_physfn(adapter))
+       if (be_virtfn(adapter))
                return num_vec;
        return 0;
 }
@@ -3159,7 +3159,7 @@ static int be_irq_register(struct be_adapter *adapter)
                if (status == 0)
                        goto done;
                /* INTx is not supported for VF */
-               if (!be_physfn(adapter))
+               if (be_virtfn(adapter))
                        return status;
        }
 
@@ -3840,8 +3840,9 @@ static void BEx_get_resources(struct be_adapter *adapter,
         *    *only* if it is RSS-capable.
         */
        if (BE2_chip(adapter) || use_sriov ||  (adapter->port_num > 1) ||
-           !be_physfn(adapter) || (be_is_mc(adapter) &&
-           !(adapter->function_caps & BE_FUNCTION_CAPS_RSS))) {
+           be_virtfn(adapter) ||
+           (be_is_mc(adapter) &&
+            !(adapter->function_caps & BE_FUNCTION_CAPS_RSS))) {
                res->max_tx_qs = 1;
        } else if (adapter->function_caps & BE_FUNCTION_CAPS_SUPER_NIC) {
                struct be_resources super_nic_res = {0};
@@ -5289,7 +5290,7 @@ static void be_unmap_pci_bars(struct be_adapter *adapter)
 
 static int db_bar(struct be_adapter *adapter)
 {
-       if (lancer_chip(adapter) || !be_physfn(adapter))
+       if (lancer_chip(adapter) || be_virtfn(adapter))
                return 0;
        else
                return 4;