Refactor the .flow_dissect procedure to call the common helper instead
of open-coding the header displacement.

Cc: John Crispin <j...@phrozen.org>
Cc: Alexander Lobakin <aloba...@pm.me>
Signed-off-by: Vladimir Oltean <vladimir.olt...@nxp.com>
---
 net/dsa/tag_qca.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c
index a75c6b20c215..bb929b8092cb 100644
--- a/net/dsa/tag_qca.c
+++ b/net/dsa/tag_qca.c
@@ -89,19 +89,12 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, 
struct net_device *dev,
        return skb;
 }
 
-static void qca_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
-                                int *offset)
-{
-       *offset = QCA_HDR_LEN;
-       *proto = ((__be16 *)skb->data)[0];
-}
-
 static const struct dsa_device_ops qca_netdev_ops = {
        .name   = "qca",
        .proto  = DSA_TAG_PROTO_QCA,
        .xmit   = qca_tag_xmit,
        .rcv    = qca_tag_rcv,
-       .flow_dissect = qca_tag_flow_dissect,
+       .flow_dissect = dsa_tag_generic_flow_dissect,
        .overhead = QCA_HDR_LEN,
 };
 
-- 
2.25.1

Reply via email to