net: mscc: simplify retrieving the tag type from the frame header
authorAntoine Tenart <antoine.tenart@bootlin.com>
Fri, 13 Jul 2018 14:57:57 +0000 (16:57 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Jul 2018 20:43:31 +0000 (13:43 -0700)
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>
drivers/net/ethernet/mscc/ocelot_board.c

index 18df7d934e810a56b967120ac1f7e9d0507d13af..26bb3b18f3be0f9f20149e5e689c561074c60a26 100644 (file)
@@ -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;