RE: [PATCH bpf-next 6/8] selftests/bpf: Fix size of map_fd in test_sockmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@xxxxxxxxxx>
> 
> The array size of map_fd[] is 9, not 8. This patch changes it as a more
> general form: ARRAY_SIZE(map_fd).
> 
> Signed-off-by: Geliang Tang <tanggeliang@xxxxxxxxxx>
> ---
>  tools/testing/selftests/bpf/test_sockmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c
> index e83ca0005721..3654babfac59 100644
> --- a/tools/testing/selftests/bpf/test_sockmap.c
> +++ b/tools/testing/selftests/bpf/test_sockmap.c
> @@ -1285,7 +1285,7 @@ static int run_options(struct sockmap_options *options, int cg_fd,  int test)
>  			bpf_link__detach(links[i]);
>  	}
>  
> -	for (i = 0; i < 8; i++) {
> +	for (i = 0; i < ARRAY_SIZE(map_fd); i++) {
>  		key = next_key = 0;
>  		bpf_map_update_elem(map_fd[i], &key, &zero, BPF_ANY);
>  		while (bpf_map_get_next_key(map_fd[i], &key, &next_key) == 0) {
> -- 
> 2.43.0
> 

Acked-by: John Fastabend <john.fastabend@xxxxxxxxx>




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux