diff mbox series

[RESEND,net-next] net: dsa: bcm_sf2: Check egress tagging of CFP rule with proper accessor

Message ID 20210203193918.2236994-1-olteanv@gmail.com (mailing list archive)
State Accepted
Commit b53014f0791cbc4925f52d7c46220845e42d0a91
Delegated to: Netdev Maintainers
Headers show
Series [RESEND,net-next] net: dsa: bcm_sf2: Check egress tagging of CFP rule with proper accessor | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 7 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 7 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Vladimir Oltean Feb. 3, 2021, 7:39 p.m. UTC
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>
---
 drivers/net/dsa/bcm_sf2_cfp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 5, 2021, 4:30 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Wed,  3 Feb 2021 21:39:18 +0200 you wrote:
> 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:
> 
> [...]

Here is the summary with links:
  - [RESEND,net-next] net: dsa: bcm_sf2: Check egress tagging of CFP rule with proper accessor
    https://git.kernel.org/netdev/net-next/c/b53014f0791c

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

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;