igc: Remove no need declaration of the igc_irq_disable
authorSasha Neftin <sasha.neftin@intel.com>
Tue, 19 Nov 2019 11:44:58 +0000 (13:44 +0200)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sun, 5 Jan 2020 06:59:29 +0000 (22:59 -0800)
We want to avoid forward-declarations of function if possible.
Rearrange the igc_irq_disable function implementation.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igc/igc_main.c

index 9597c5753d6b13d1ddee2f3706aff9c83991b094..4cfb9856ee130d73c2a0482712ffacaed3068162 100644 (file)
@@ -57,7 +57,6 @@ static void igc_write_itr(struct igc_q_vector *q_vector);
 static void igc_assign_vector(struct igc_q_vector *q_vector, int msix_vector);
 static void igc_free_q_vector(struct igc_adapter *adapter, int v_idx);
 static void igc_free_q_vectors(struct igc_adapter *adapter);
-static void igc_irq_disable(struct igc_adapter *adapter);
 
 enum latency_range {
        lowest_latency = 0,
@@ -2265,6 +2264,39 @@ static void igc_irq_enable(struct igc_adapter *adapter)
        }
 }
 
+/**
+ * igc_irq_disable - Mask off interrupt generation on the NIC
+ * @adapter: board private structure
+ */
+static void igc_irq_disable(struct igc_adapter *adapter)
+{
+       struct igc_hw *hw = &adapter->hw;
+
+       if (adapter->msix_entries) {
+               u32 regval = rd32(IGC_EIAM);
+
+               wr32(IGC_EIAM, regval & ~adapter->eims_enable_mask);
+               wr32(IGC_EIMC, adapter->eims_enable_mask);
+               regval = rd32(IGC_EIAC);
+               wr32(IGC_EIAC, regval & ~adapter->eims_enable_mask);
+       }
+
+       wr32(IGC_IAM, 0);
+       wr32(IGC_IMC, ~0);
+       wrfl();
+
+       if (adapter->msix_entries) {
+               int vector = 0, i;
+
+               synchronize_irq(adapter->msix_entries[vector++].vector);
+
+               for (i = 0; i < adapter->num_q_vectors; i++)
+                       synchronize_irq(adapter->msix_entries[vector++].vector);
+       } else {
+               synchronize_irq(adapter->pdev->irq);
+       }
+}
+
 /**
  * igc_up - Open the interface and prepare it to handle traffic
  * @adapter: board private structure
@@ -3961,39 +3993,6 @@ static void igc_free_irq(struct igc_adapter *adapter)
        }
 }
 
-/**
- * igc_irq_disable - Mask off interrupt generation on the NIC
- * @adapter: board private structure
- */
-static void igc_irq_disable(struct igc_adapter *adapter)
-{
-       struct igc_hw *hw = &adapter->hw;
-
-       if (adapter->msix_entries) {
-               u32 regval = rd32(IGC_EIAM);
-
-               wr32(IGC_EIAM, regval & ~adapter->eims_enable_mask);
-               wr32(IGC_EIMC, adapter->eims_enable_mask);
-               regval = rd32(IGC_EIAC);
-               wr32(IGC_EIAC, regval & ~adapter->eims_enable_mask);
-       }
-
-       wr32(IGC_IAM, 0);
-       wr32(IGC_IMC, ~0);
-       wrfl();
-
-       if (adapter->msix_entries) {
-               int vector = 0, i;
-
-               synchronize_irq(adapter->msix_entries[vector++].vector);
-
-               for (i = 0; i < adapter->num_q_vectors; i++)
-                       synchronize_irq(adapter->msix_entries[vector++].vector);
-       } else {
-               synchronize_irq(adapter->pdev->irq);
-       }
-}
-
 /**
  * igc_request_irq - initialize interrupts
  * @adapter: Pointer to adapter structure