]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: enetc: remove unnecessary CONFIG_FSL_ENETC_PTP_CLOCK check
authorWei Fang <wei.fang@nxp.com>
Fri, 29 Aug 2025 05:06:12 +0000 (13:06 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 2 Sep 2025 11:13:34 +0000 (13:13 +0200)
The ENETC_F_RX_TSTAMP flag of priv->active_offloads can only be set when
CONFIG_FSL_ENETC_PTP_CLOCK is enabled. Similarly, rx_ring->ext_en can
only be set when CONFIG_FSL_ENETC_PTP_CLOCK is enabled as well. So it is
safe to remove unnecessary CONFIG_FSL_ENETC_PTP_CLOCK check.

Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20250829050615.1247468-12-wei.fang@nxp.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/freescale/enetc/enetc.c
drivers/net/ethernet/freescale/enetc/enetc.h

index ef002ed2fdb92b520cb523ffbb615e64fba25d1b..4325eb3d9481807940db7520bb7ccc889c5255ff 100644 (file)
@@ -1411,8 +1411,7 @@ static void enetc_get_offloads(struct enetc_bdr *rx_ring,
                __vlan_hwaccel_put_tag(skb, tpid, le16_to_cpu(rxbd->r.vlan_opt));
        }
 
-       if (IS_ENABLED(CONFIG_FSL_ENETC_PTP_CLOCK) &&
-           (priv->active_offloads & ENETC_F_RX_TSTAMP))
+       if (priv->active_offloads & ENETC_F_RX_TSTAMP)
                enetc_get_rx_tstamp(rx_ring->ndev, rxbd, skb);
 }
 
index ce3fed95091bc81a017a86aa0018b9f701ab69a9..c65aa7b8812208fa5943abae431a8b8f766f00f7 100644 (file)
@@ -226,7 +226,7 @@ static inline union enetc_rx_bd *enetc_rxbd(struct enetc_bdr *rx_ring, int i)
 {
        int hw_idx = i;
 
-       if (IS_ENABLED(CONFIG_FSL_ENETC_PTP_CLOCK) && rx_ring->ext_en)
+       if (rx_ring->ext_en)
                hw_idx = 2 * i;
 
        return &(((union enetc_rx_bd *)rx_ring->bd_base)[hw_idx]);
@@ -240,7 +240,7 @@ static inline void enetc_rxbd_next(struct enetc_bdr *rx_ring,
 
        new_rxbd++;
 
-       if (IS_ENABLED(CONFIG_FSL_ENETC_PTP_CLOCK) && rx_ring->ext_en)
+       if (rx_ring->ext_en)
                new_rxbd++;
 
        if (unlikely(++new_index == rx_ring->bd_count)) {