net/sched: cls_flower: Use correct inline function for assignment of vlan tpid
authorJianbo Liu <jianbol@mellanox.com>
Wed, 25 Jul 2018 02:31:25 +0000 (02:31 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Jul 2018 23:33:02 +0000 (16:33 -0700)
This fixes the following sparse warning:

net/sched/cls_flower.c:1356:36: warning: incorrect type in argument 3 (different base types)
net/sched/cls_flower.c:1356:36: expected unsigned short [unsigned] [usertype] value
net/sched/cls_flower.c:1356:36: got restricted __be16 [usertype] vlan_tpid

Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
Reported-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_flower.c

index 6ccf603642974d94ecef0b08b6baba536ec94d9c..e8bd08ba998a9bf6c12cb13e32bd297fc7cf10cd 100644 (file)
@@ -1445,8 +1445,8 @@ static int fl_dump_key(struct sk_buff *skb, struct net *net,
                             TCA_FLOWER_KEY_CVLAN_PRIO,
                             &key->cvlan, &mask->cvlan) ||
            (mask->cvlan.vlan_tpid &&
-            nla_put_u16(skb, TCA_FLOWER_KEY_VLAN_ETH_TYPE,
-                        key->cvlan.vlan_tpid)))
+            nla_put_be16(skb, TCA_FLOWER_KEY_VLAN_ETH_TYPE,
+                         key->cvlan.vlan_tpid)))
                goto nla_put_failure;
 
        if (mask->basic.n_proto) {