All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] bpf: devmap: remove redundant assignment of variable drops
@ 2021-05-27 14:36 Colin King
  2021-05-27 14:55 ` Maciej Fijalkowski
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2021-05-27 14:36 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, David S . Miller,
	Jakub Kicinski, Jesper Dangaard Brouer, John Fastabend,
	Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
	KP Singh, netdev, bpf
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable drops is being assigned a value that is never
read, it is being updated later on. The assignment is redundant and
can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 kernel/bpf/devmap.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c
index f9148daab0e3..fe3873b5d13d 100644
--- a/kernel/bpf/devmap.c
+++ b/kernel/bpf/devmap.c
@@ -388,8 +388,6 @@ static void bq_xmit_all(struct xdp_dev_bulk_queue *bq, u32 flags)
 		to_send = dev_map_bpf_prog_run(bq->xdp_prog, bq->q, cnt, dev);
 		if (!to_send)
 			goto out;
-
-		drops = cnt - to_send;
 	}
 
 	sent = dev->netdev_ops->ndo_xdp_xmit(dev, to_send, bq->q, flags);
-- 
2.31.1


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

* Re: [PATCH][next] bpf: devmap: remove redundant assignment of variable drops
  2021-05-27 14:36 [PATCH][next] bpf: devmap: remove redundant assignment of variable drops Colin King
@ 2021-05-27 14:55 ` Maciej Fijalkowski
  2021-05-28 20:21   ` Daniel Borkmann
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej Fijalkowski @ 2021-05-27 14:55 UTC (permalink / raw)
  To: Colin King
  Cc: Alexei Starovoitov, Daniel Borkmann, David S . Miller,
	Jakub Kicinski, Jesper Dangaard Brouer, John Fastabend,
	Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
	KP Singh, netdev, bpf, kernel-janitors, linux-kernel

On Thu, May 27, 2021 at 03:36:37PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable drops is being assigned a value that is never
> read, it is being updated later on. The assignment is redundant and
> can be removed.

Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

Would help if you would have CCed me given the fact that hour ago I
confirmed that it could be removed :p but no big deal.

Thanks!

> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  kernel/bpf/devmap.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c
> index f9148daab0e3..fe3873b5d13d 100644
> --- a/kernel/bpf/devmap.c
> +++ b/kernel/bpf/devmap.c
> @@ -388,8 +388,6 @@ static void bq_xmit_all(struct xdp_dev_bulk_queue *bq, u32 flags)
>  		to_send = dev_map_bpf_prog_run(bq->xdp_prog, bq->q, cnt, dev);
>  		if (!to_send)
>  			goto out;
> -
> -		drops = cnt - to_send;
>  	}
>  
>  	sent = dev->netdev_ops->ndo_xdp_xmit(dev, to_send, bq->q, flags);
> -- 
> 2.31.1
> 

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

* Re: [PATCH][next] bpf: devmap: remove redundant assignment of variable drops
  2021-05-27 14:55 ` Maciej Fijalkowski
@ 2021-05-28 20:21   ` Daniel Borkmann
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2021-05-28 20:21 UTC (permalink / raw)
  To: Maciej Fijalkowski, Colin King
  Cc: Alexei Starovoitov, David S . Miller, Jakub Kicinski,
	Jesper Dangaard Brouer, John Fastabend, Andrii Nakryiko,
	Martin KaFai Lau, Song Liu, Yonghong Song, KP Singh, netdev, bpf,
	kernel-janitors, linux-kernel

On 5/27/21 4:55 PM, Maciej Fijalkowski wrote:
> On Thu, May 27, 2021 at 03:36:37PM +0100, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The variable drops is being assigned a value that is never
>> read, it is being updated later on. The assignment is redundant and
>> can be removed.
> 
> Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> 
> Would help if you would have CCed me given the fact that hour ago I
> confirmed that it could be removed :p but no big deal.

Thanks guys, fyi, took in this one for bpf-next [0], since more unneeded
code removed.

   [0] https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=e8e0f0f484780d7b90a63ea50020ac4bb027178d

>> Addresses-Coverity: ("Unused value")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>   kernel/bpf/devmap.c | 2 --
>>   1 file changed, 2 deletions(-)
>>
>> diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c
>> index f9148daab0e3..fe3873b5d13d 100644
>> --- a/kernel/bpf/devmap.c
>> +++ b/kernel/bpf/devmap.c
>> @@ -388,8 +388,6 @@ static void bq_xmit_all(struct xdp_dev_bulk_queue *bq, u32 flags)
>>   		to_send = dev_map_bpf_prog_run(bq->xdp_prog, bq->q, cnt, dev);
>>   		if (!to_send)
>>   			goto out;
>> -
>> -		drops = cnt - to_send;
>>   	}
>>   
>>   	sent = dev->netdev_ops->ndo_xdp_xmit(dev, to_send, bq->q, flags);
>> -- 
>> 2.31.1
>>


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

end of thread, other threads:[~2021-05-28 20:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-27 14:36 [PATCH][next] bpf: devmap: remove redundant assignment of variable drops Colin King
2021-05-27 14:55 ` Maciej Fijalkowski
2021-05-28 20:21   ` Daniel Borkmann

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.