All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][net-next] tun: remove unnecessary check in tun_flow_update
@ 2018-12-06  8:28 Li RongQing
  2018-12-06  9:57 ` Jason Wang
  2018-12-06 20:16 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Li RongQing @ 2018-12-06  8:28 UTC (permalink / raw)
  To: netdev

caller has guaranted that rxhash is not zero

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 drivers/net/tun.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index d0745dc81976..6760b86547df 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -529,10 +529,7 @@ static void tun_flow_update(struct tun_struct *tun, u32 rxhash,
 	unsigned long delay = tun->ageing_time;
 	u16 queue_index = tfile->queue_index;
 
-	if (!rxhash)
-		return;
-	else
-		head = &tun->flows[tun_hashfn(rxhash)];
+	head = &tun->flows[tun_hashfn(rxhash)];
 
 	rcu_read_lock();
 
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][net-next] tun: remove unnecessary check in tun_flow_update
  2018-12-06  8:28 [PATCH][net-next] tun: remove unnecessary check in tun_flow_update Li RongQing
@ 2018-12-06  9:57 ` Jason Wang
  2018-12-06 20:16 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Wang @ 2018-12-06  9:57 UTC (permalink / raw)
  To: Li RongQing, netdev


On 2018/12/6 下午4:28, Li RongQing wrote:
> caller has guaranted that rxhash is not zero
>
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> ---
>   drivers/net/tun.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index d0745dc81976..6760b86547df 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -529,10 +529,7 @@ static void tun_flow_update(struct tun_struct *tun, u32 rxhash,
>   	unsigned long delay = tun->ageing_time;
>   	u16 queue_index = tfile->queue_index;
>   
> -	if (!rxhash)
> -		return;
> -	else
> -		head = &tun->flows[tun_hashfn(rxhash)];
> +	head = &tun->flows[tun_hashfn(rxhash)];
>   
>   	rcu_read_lock();
>   


Acked-by: Jason Wang <jasowang@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][net-next] tun: remove unnecessary check in tun_flow_update
  2018-12-06  8:28 [PATCH][net-next] tun: remove unnecessary check in tun_flow_update Li RongQing
  2018-12-06  9:57 ` Jason Wang
@ 2018-12-06 20:16 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-12-06 20:16 UTC (permalink / raw)
  To: lirongqing; +Cc: netdev

From: Li RongQing <lirongqing@baidu.com>
Date: Thu,  6 Dec 2018 16:28:11 +0800

> caller has guaranted that rxhash is not zero
> 
> Signed-off-by: Li RongQing <lirongqing@baidu.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-06 20:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-06  8:28 [PATCH][net-next] tun: remove unnecessary check in tun_flow_update Li RongQing
2018-12-06  9:57 ` Jason Wang
2018-12-06 20:16 ` David Miller

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.