]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
dpaa2-eth: use new PTP_MSGTYPE_* define(s)
authorChristian Eggers <ceggers@arri.de>
Fri, 20 Nov 2020 08:41:05 +0000 (09:41 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 23 Nov 2020 21:43:31 +0000 (13:43 -0800)
Remove usage of magic numbers.

Signed-off-by: Christian Eggers <ceggers@arri.de>
Cc: Ioana Ciornei <ioana.ciornei@nxp.com>
Cc: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Cc: Yangbo Lu <yangbo.lu@nxp.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c

index cf9400a9886d7a6a80fcd597467eca6ea3d2f6ef..a0a30c721fe783c548f199fd55bb3d4eeebc7d93 100644 (file)
@@ -686,7 +686,7 @@ static void dpaa2_eth_enable_tx_tstamp(struct dpaa2_eth_priv *priv,
        if (skb->cb[0] == TX_TSTAMP_ONESTEP_SYNC) {
                if (dpaa2_eth_ptp_parse(skb, &msgtype, &twostep, &udp,
                                        &offset1, &offset2) ||
-                   msgtype != 0 || twostep) {
+                   msgtype != PTP_MSGTYPE_SYNC || twostep) {
                        WARN_ONCE(1, "Bad packet for one-step timestamping\n");
                        return;
                }
@@ -1212,7 +1212,7 @@ static netdev_tx_t dpaa2_eth_tx(struct sk_buff *skb, struct net_device *net_dev)
        if (skb->cb[0] == TX_TSTAMP_ONESTEP_SYNC) {
                if (!dpaa2_eth_ptp_parse(skb, &msgtype, &twostep, &udp,
                                         &offset1, &offset2))
-                       if (msgtype == 0 && twostep == 0) {
+                       if (msgtype == PTP_MSGTYPE_SYNC && twostep == 0) {
                                skb_queue_tail(&priv->tx_skbs, skb);
                                queue_work(priv->dpaa2_ptp_wq,
                                           &priv->tx_onestep_tstamp);