ixgbe: ptp code cleanup
authorJacob Keller <jacob.e.keller@intel.com>
Tue, 22 May 2012 06:08:32 +0000 (06:08 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 14 Jun 2012 10:13:06 +0000 (03:13 -0700)
This patch fixes two minor nits from Richard Cochran. The first is a case of
ambitious line wrapping that wasn't necessary. The second is to re-order the
flag checks for PPS support. Previously, the hardware test was done first, and
the interrupt flag test was done second. Now, test the interrupt flag and use
the unlikely macro.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c

index 17ad6a3..1675b66 100644 (file)
@@ -790,12 +790,10 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
                total_packets += tx_buffer->gso_segs;
 
 #ifdef CONFIG_IXGBE_PTP
-               if (unlikely(tx_buffer->tx_flags &
-                            IXGBE_TX_FLAGS_TSTAMP))
-                       ixgbe_ptp_tx_hwtstamp(q_vector,
-                                             tx_buffer->skb);
-
+               if (unlikely(tx_buffer->tx_flags & IXGBE_TX_FLAGS_TSTAMP))
+                       ixgbe_ptp_tx_hwtstamp(q_vector, tx_buffer->skb);
 #endif
+
                /* free the skb */
                dev_kfree_skb_any(tx_buffer->skb);
 
index ddc6a4d..174f41f 100644 (file)
@@ -307,13 +307,14 @@ void ixgbe_ptp_check_pps_event(struct ixgbe_adapter *adapter, u32 eicr)
            !(adapter->flags2 & IXGBE_FLAG2_PTP_PPS_ENABLED))
                return;
 
-       switch (hw->mac.type) {
-       case ixgbe_mac_X540:
-               if (eicr & IXGBE_EICR_TIMESYNC)
+       if (unlikely(eicr & IXGBE_EICR_TIMESYNC)) {
+               switch (hw->mac.type) {
+               case ixgbe_mac_X540:
                        ptp_clock_event(adapter->ptp_clock, &event);
-               break;
-       default:
-               break;
+                       break;
+               default:
+                       break;
+               }
        }
 }