net/sched: cls_flower: use ntohs for struct flow_dissector_key_ports
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sun, 21 Mar 2021 21:05:48 +0000 (23:05 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Mar 2021 19:48:20 +0000 (12:48 -0700)
commit6215afcb9a7e35cef334dc0ae7f998cc72c8465f
treee8f51af46877302060739a22112c0232fb05f17e
parentf57bac3c33e761fdd78fef159fdc677056c706d0
net/sched: cls_flower: use ntohs for struct flow_dissector_key_ports

A make W=1 build complains that:

net/sched/cls_flower.c:214:20: warning: cast from restricted __be16
net/sched/cls_flower.c:214:20: warning: incorrect type in argument 1 (different base types)
net/sched/cls_flower.c:214:20:    expected unsigned short [usertype] val
net/sched/cls_flower.c:214:20:    got restricted __be16 [usertype] dst

This is because we use htons on struct flow_dissector_key_ports members
src and dst, which are defined as __be16, so they are already in network
byte order, not host. The byte swap function for the other direction
should have been used.

Because htons and ntohs do the same thing (either both swap, or none
does), this change has no functional effect except to silence the
warnings.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_flower.c