summaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/bcm_sf2_cfp.c
diff options
context:
space:
mode:
authorVladimir Oltean <olteanv@gmail.com>2021-02-03 21:39:18 +0200
committerJakub Kicinski <kuba@kernel.org>2021-02-04 19:08:52 -0800
commitb53014f0791cbc4925f52d7c46220845e42d0a91 (patch)
treedef7bb69c73d5da7fda648dfcc0dc5a58af9c903 /drivers/net/dsa/bcm_sf2_cfp.c
parent53b823b29aac320b2d4b64fc79af869720c73cf5 (diff)
downloadlinux-b53014f0791cbc4925f52d7c46220845e42d0a91.tar.gz
linux-b53014f0791cbc4925f52d7c46220845e42d0a91.tar.bz2
linux-b53014f0791cbc4925f52d7c46220845e42d0a91.zip
net: dsa: bcm_sf2: Check egress tagging of CFP rule with proper accessor
The flow steering struct ethtool_flow_ext::data field is __be32, so when the CFP code needs to check the VLAN egress tagging attribute in bit 0, it does this in CPU native endianness. So logically, the endianness conversion is set up the other way around, although in practice the same result is produced. Gets rid of build warning: warning: cast from restricted __be32 warning: incorrect type in argument 1 (different base types) expected unsigned int [usertype] val got restricted __be32 warning: cast from restricted __be32 warning: cast from restricted __be32 warning: cast from restricted __be32 warning: cast from restricted __be32 warning: restricted __be32 degrades to integer Signed-off-by: Vladimir Oltean <olteanv@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20210203193918.2236994-1-olteanv@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/dsa/bcm_sf2_cfp.c')
-rw-r--r--drivers/net/dsa/bcm_sf2_cfp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/dsa/bcm_sf2_cfp.c b/drivers/net/dsa/bcm_sf2_cfp.c
index ed45d16250e1..178218cf73a3 100644
--- a/drivers/net/dsa/bcm_sf2_cfp.c
+++ b/drivers/net/dsa/bcm_sf2_cfp.c
@@ -886,7 +886,7 @@ static int bcm_sf2_cfp_rule_insert(struct dsa_switch *ds, int port,
vid = be16_to_cpu(fs->h_ext.vlan_tci) & VLAN_VID_MASK;
vlan.vid = vid;
- if (cpu_to_be32(fs->h_ext.data[1]) & 1)
+ if (be32_to_cpu(fs->h_ext.data[1]) & 1)
vlan.flags = BRIDGE_VLAN_INFO_UNTAGGED;
else
vlan.flags = 0;