diff mbox series

selftests/bpf: Convert comma to semicolon

Message ID 20250310032045.651068-1-nichen@iscas.ac.cn (mailing list archive)
State New
Headers show
Series selftests/bpf: Convert comma to semicolon | expand

Commit Message

Chen Ni March 10, 2025, 3:20 a.m. UTC
Replace comma between expressions with semicolons.

Using a ',' in place of a ';' can have unintended side effects.
Although that is not the case here, it is seems best to use ';'
unless ',' is intended.

Found by inspection.
No functional change intended.
Compile tested only.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
 tools/testing/selftests/bpf/prog_tests/fd_array.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Anton Protopopov March 10, 2025, 8:09 a.m. UTC | #1
On 25/03/10 11:20AM, Chen Ni wrote:
> Replace comma between expressions with semicolons.
> 
> Using a ',' in place of a ';' can have unintended side effects.
> Although that is not the case here, it is seems best to use ';'
> unless ',' is intended.

This is a typo, of course. Thanks!

> Found by inspection.
> No functional change intended.
> Compile tested only.
> 
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>

Acked-by: Anton Protopopov <aspsk@isovalent.com>

> ---
>  tools/testing/selftests/bpf/prog_tests/fd_array.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/bpf/prog_tests/fd_array.c b/tools/testing/selftests/bpf/prog_tests/fd_array.c
> index a1d52e73fb16..9add890c2d37 100644
> --- a/tools/testing/selftests/bpf/prog_tests/fd_array.c
> +++ b/tools/testing/selftests/bpf/prog_tests/fd_array.c
> @@ -83,8 +83,8 @@ static inline int bpf_prog_get_map_ids(int prog_fd, __u32 *nr_map_ids, __u32 *ma
>  	int err;
>  
>  	memset(&info, 0, len);
> -	info.nr_map_ids = *nr_map_ids,
> -	info.map_ids = ptr_to_u64(map_ids),
> +	info.nr_map_ids = *nr_map_ids;
> +	info.map_ids = ptr_to_u64(map_ids);
>  
>  	err = bpf_prog_get_info_by_fd(prog_fd, &info, &len);
>  	if (!ASSERT_OK(err, "bpf_prog_get_info_by_fd"))
> -- 
> 2.25.1
>
patchwork-bot+netdevbpf@kernel.org March 11, 2025, midnight UTC | #2
Hello:

This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Mon, 10 Mar 2025 11:20:45 +0800 you wrote:
> Replace comma between expressions with semicolons.
> 
> Using a ',' in place of a ';' can have unintended side effects.
> Although that is not the case here, it is seems best to use ';'
> unless ',' is intended.
> 
> Found by inspection.
> No functional change intended.
> Compile tested only.
> 
> [...]

Here is the summary with links:
  - selftests/bpf: Convert comma to semicolon
    https://git.kernel.org/bpf/bpf-next/c/233732b289f6

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/prog_tests/fd_array.c b/tools/testing/selftests/bpf/prog_tests/fd_array.c
index a1d52e73fb16..9add890c2d37 100644
--- a/tools/testing/selftests/bpf/prog_tests/fd_array.c
+++ b/tools/testing/selftests/bpf/prog_tests/fd_array.c
@@ -83,8 +83,8 @@  static inline int bpf_prog_get_map_ids(int prog_fd, __u32 *nr_map_ids, __u32 *ma
 	int err;
 
 	memset(&info, 0, len);
-	info.nr_map_ids = *nr_map_ids,
-	info.map_ids = ptr_to_u64(map_ids),
+	info.nr_map_ids = *nr_map_ids;
+	info.map_ids = ptr_to_u64(map_ids);
 
 	err = bpf_prog_get_info_by_fd(prog_fd, &info, &len);
 	if (!ASSERT_OK(err, "bpf_prog_get_info_by_fd"))