[net-next,7/9] net: dsa: tag_sja1105: replace skb_mac_header() with vlan_eth_hdr()

Message ID 20230322233823.1806736-8-vladimir.oltean@nxp.com
State New
Headers
Series Remove skb_mac_header() dependency in DSA xmit path |

Commit Message

Vladimir Oltean March 22, 2023, 11:38 p.m. UTC
  This is a cosmetic patch which consolidates the code to use the helper
function offered by if_vlan.h.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 net/dsa/tag_sja1105.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Simon Horman March 23, 2023, 4:12 p.m. UTC | #1
On Thu, Mar 23, 2023 at 01:38:21AM +0200, Vladimir Oltean wrote:
> This is a cosmetic patch which consolidates the code to use the helper
> function offered by if_vlan.h.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>
  
Florian Fainelli March 23, 2023, 4:32 p.m. UTC | #2
On 3/22/23 16:38, Vladimir Oltean wrote:
> This is a cosmetic patch which consolidates the code to use the helper
> function offered by if_vlan.h.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
  

Patch

diff --git a/net/dsa/tag_sja1105.c b/net/dsa/tag_sja1105.c
index a7ca97b7ac9e..a5f3b73da417 100644
--- a/net/dsa/tag_sja1105.c
+++ b/net/dsa/tag_sja1105.c
@@ -516,7 +516,7 @@  static bool sja1110_skb_has_inband_control_extension(const struct sk_buff *skb)
 static void sja1105_vlan_rcv(struct sk_buff *skb, int *source_port,
 			     int *switch_id, int *vbid, u16 *vid)
 {
-	struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)skb_mac_header(skb);
+	struct vlan_ethhdr *hdr = vlan_eth_hdr(skb);
 	u16 vlan_tci;
 
 	if (skb_vlan_tag_present(skb))