net: mscc: ocelot: access EtherType using __be16

Get rid of sparse "cast to restricted __be16" warnings.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Vladimir Oltean 2020-06-20 18:43:38 +03:00 committed by David S. Miller
parent 7eb5c96a7c
commit ff4b0bc623
2 changed files with 4 additions and 4 deletions

View File

@ -746,8 +746,8 @@ static bool ocelot_ace_is_problematic_mac_etype(struct ocelot_ace_rule *ace)
if (ace->type != OCELOT_ACE_TYPE_ETYPE)
return false;
proto = ntohs(*(u16 *)ace->frame.etype.etype.value);
mask = ntohs(*(u16 *)ace->frame.etype.etype.mask);
proto = ntohs(*(__be16 *)ace->frame.etype.etype.value);
mask = ntohs(*(__be16 *)ace->frame.etype.etype.mask);
/* ETH_P_ALL match, so all protocols below are included */
if (mask == 0)

View File

@ -176,8 +176,8 @@ finished_key_parsing:
if (proto < ETH_P_802_3_MIN)
return -EOPNOTSUPP;
ace->type = OCELOT_ACE_TYPE_ETYPE;
*(u16 *)ace->frame.etype.etype.value = htons(proto);
*(u16 *)ace->frame.etype.etype.mask = 0xffff;
*(__be16 *)ace->frame.etype.etype.value = htons(proto);
*(__be16 *)ace->frame.etype.etype.mask = htons(0xffff);
}
/* else, a rule of type OCELOT_ACE_TYPE_ANY is implicitly added */