Skip to content

Commit

Permalink
net: mscc: simplify retrieving the tag type from the frame header
Browse files Browse the repository at this point in the history
The tag type in the frame extraction header is only a bit wide. There's
no need to use GENMASK when retrieving the information. This patch
simplify the code by dropping GENMASK and using BIT instead.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Antoine Tenart authored and David S. Miller committed Jul 16, 2018
1 parent bc1b503 commit 4950838
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mscc/ocelot_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static int ocelot_parse_ifh(u32 *ifh, struct frame_info *info)
info->port = (ifh[2] & GENMASK(14, 11)) >> 11;

info->cpuq = (ifh[3] & GENMASK(27, 20)) >> 20;
info->tag_type = (ifh[3] & GENMASK(16, 16)) >> 16;
info->tag_type = (ifh[3] & BIT(16)) >> 16;
info->vid = ifh[3] & GENMASK(11, 0);

return 0;
Expand Down

0 comments on commit 4950838

Please sign in to comment.