All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Antoine Tenart <antoine.tenart@bootlin.com>
Cc: davem@davemloft.net, f.fainelli@gmail.com, andrew@lunn.ch,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	thomas.petazzoni@bootlin.com, quentin.schulz@bootlin.com,
	allan.nielsen@microsemi.com
Subject: Re: [PATCH net-next] net: mscc: simplify retrieving the tag type from the frame header
Date: Mon, 16 Jul 2018 16:17:12 +0200	[thread overview]
Message-ID: <20180716141712.GA5983@piout.net> (raw)
In-Reply-To: <20180713145757.3574-1-antoine.tenart@bootlin.com>

On 13/07/2018 16:57:57+0200, Antoine Ténart wrote:
> 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>

> ---
>  drivers/net/ethernet/mscc/ocelot_board.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mscc/ocelot_board.c b/drivers/net/ethernet/mscc/ocelot_board.c
> index 18df7d934e81..26bb3b18f3be 100644
> --- a/drivers/net/ethernet/mscc/ocelot_board.c
> +++ b/drivers/net/ethernet/mscc/ocelot_board.c
> @@ -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;
> -- 
> 2.17.1
> 

-- 
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2018-07-16 14:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-13 14:57 [PATCH net-next] net: mscc: simplify retrieving the tag type from the frame header Antoine Tenart
2018-07-16 14:17 ` Alexandre Belloni [this message]
2018-07-16 20:44 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180716141712.GA5983@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=allan.nielsen@microsemi.com \
    --cc=andrew@lunn.ch \
    --cc=antoine.tenart@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=quentin.schulz@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.