On Sun, 2016-11-20 at 19:21 +0800, f...@ikuai8.com wrote:
> From: Gao Feng <gfree.w...@gmail.com>
> 
> The condition check "dev->flags & IFF_UP" is duplicated in
> macvlan_forward_source_one, because its caller macvlan_forward_source
> has already checked this flag.
> 
> Signed-off-by: Gao Feng <gfree.w...@gmail.com>
> ---
>  drivers/net/macvlan.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
> index 13b7e0b..95a5ffc 100644
> --- a/drivers/net/macvlan.c
> +++ b/drivers/net/macvlan.c
> @@ -375,9 +375,6 @@ static void macvlan_forward_source_one(struct sk_buff 
> *skb,
>       int ret;
>  
>       dev = vlan->dev;
> -     if (unlikely(!(dev->flags & IFF_UP)))
> -             return;
> -
>       nskb = skb_clone(skb, GFP_ATOMIC);
>       if (!nskb)
>               return;

If you don't mind, I would rather remove the test in the caller and
leave it here. It is likely compiler inlines the function anyway, so
there is no performance change.


Reply via email to