* [PATCH bpf-next] selftests/bpf: Fix const qualifier warning in fexit_bpf2bpf.c
@ 2026-03-05 22:21 Varun R Mallya
2026-03-06 1:16 ` Menglong Dong
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Varun R Mallya @ 2026-03-05 22:21 UTC (permalink / raw)
To: andrii, eddyz87, toke
Cc: ast, daniel, song, bpf, linux-kselftest, linux-kernel,
varunrmallya
Building selftests with
clang 23.0.0 (6fae863eba8a72cdd82f37e7111a46a70be525e0) triggers
the following error:
tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c:117:12:
error: assigning to 'char *' from 'const char *' discards qualifiers
[-Werror,-Wincompatible-pointer-types-discards-qualifiers]
The variable `tgt_name` is declared as `char *`, but it stores the
result of strstr(prog_name[i], "/"). Since `prog_name[i]` is a
`const char *`, the returned pointer should also be treated as
const-qualified.
Update `tgt_name` to `const char *` to match the type of the underlying
string and silence the compiler warning.
Signed-off-by: Varun R Mallya <varunrmallya@gmail.com>
---
tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
index 23d933f1aec6..92c20803ea76 100644
--- a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
+++ b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
@@ -111,7 +111,7 @@ static void test_fexit_bpf2bpf_common(const char *obj_file,
struct bpf_link_info link_info;
struct bpf_program *pos;
const char *pos_sec_name;
- char *tgt_name;
+ const char *tgt_name;
__s32 btf_id;
tgt_name = strstr(prog_name[i], "/");
--
2.53.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: Fix const qualifier warning in fexit_bpf2bpf.c
2026-03-05 22:21 [PATCH bpf-next] selftests/bpf: Fix const qualifier warning in fexit_bpf2bpf.c Varun R Mallya
@ 2026-03-06 1:16 ` Menglong Dong
2026-03-06 1:40 ` Alexei Starovoitov
2026-03-06 12:11 ` Varun R Mallya
2026-03-11 18:20 ` patchwork-bot+netdevbpf
2 siblings, 1 reply; 7+ messages in thread
From: Menglong Dong @ 2026-03-06 1:16 UTC (permalink / raw)
To: Varun R Mallya
Cc: andrii, eddyz87, toke, ast, daniel, song, bpf, linux-kselftest,
linux-kernel, varunrmallya
On 2026/3/6 06:21 Varun R Mallya <varunrmallya@gmail.com> write:
> Building selftests with
> clang 23.0.0 (6fae863eba8a72cdd82f37e7111a46a70be525e0) triggers
> the following error:
>
> tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c:117:12:
> error: assigning to 'char *' from 'const char *' discards qualifiers
> [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
>
> The variable `tgt_name` is declared as `char *`, but it stores the
> result of strstr(prog_name[i], "/"). Since `prog_name[i]` is a
> `const char *`, the returned pointer should also be treated as
> const-qualified.
>
> Update `tgt_name` to `const char *` to match the type of the underlying
> string and silence the compiler warning.
>
> Signed-off-by: Varun R Mallya <varunrmallya@gmail.com>
> ---
> tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
> index 23d933f1aec6..92c20803ea76 100644
> --- a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
> +++ b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
> @@ -111,7 +111,7 @@ static void test_fexit_bpf2bpf_common(const char *obj_file,
> struct bpf_link_info link_info;
> struct bpf_program *pos;
> const char *pos_sec_name;
> - char *tgt_name;
> + const char *tgt_name;
I have been suffering from this build error too. So,
Acked-by: Menglong Dong <menglong.dong@linux.dev>
> __s32 btf_id;
>
> tgt_name = strstr(prog_name[i], "/");
> --
> 2.53.0
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: Fix const qualifier warning in fexit_bpf2bpf.c
2026-03-06 1:16 ` Menglong Dong
@ 2026-03-06 1:40 ` Alexei Starovoitov
2026-03-06 2:26 ` Alexei Starovoitov
0 siblings, 1 reply; 7+ messages in thread
From: Alexei Starovoitov @ 2026-03-06 1:40 UTC (permalink / raw)
To: Menglong Dong
Cc: Varun R Mallya, Andrii Nakryiko, Eduard,
Toke Høiland-Jørgensen, Alexei Starovoitov,
Daniel Borkmann, Song Liu, bpf,
open list:KERNEL SELFTEST FRAMEWORK, LKML
On Thu, Mar 5, 2026 at 5:16 PM Menglong Dong <menglong.dong@linux.dev> wrote:
>
> On 2026/3/6 06:21 Varun R Mallya <varunrmallya@gmail.com> write:
> > Building selftests with
> > clang 23.0.0 (6fae863eba8a72cdd82f37e7111a46a70be525e0) triggers
> > the following error:
> >
> > tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c:117:12:
> > error: assigning to 'char *' from 'const char *' discards qualifiers
> > [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
> >
> > The variable `tgt_name` is declared as `char *`, but it stores the
> > result of strstr(prog_name[i], "/"). Since `prog_name[i]` is a
> > `const char *`, the returned pointer should also be treated as
> > const-qualified.
> >
> > Update `tgt_name` to `const char *` to match the type of the underlying
> > string and silence the compiler warning.
> >
> > Signed-off-by: Varun R Mallya <varunrmallya@gmail.com>
> > ---
> > tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
> > index 23d933f1aec6..92c20803ea76 100644
> > --- a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
> > +++ b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
> > @@ -111,7 +111,7 @@ static void test_fexit_bpf2bpf_common(const char *obj_file,
> > struct bpf_link_info link_info;
> > struct bpf_program *pos;
> > const char *pos_sec_name;
> > - char *tgt_name;
> > + const char *tgt_name;
>
> I have been suffering from this build error too. So,
>
> Acked-by: Menglong Dong <menglong.dong@linux.dev>
Looks like this patch was lost. Pls resend.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: Fix const qualifier warning in fexit_bpf2bpf.c
2026-03-06 1:40 ` Alexei Starovoitov
@ 2026-03-06 2:26 ` Alexei Starovoitov
2026-03-06 2:47 ` Menglong Dong
0 siblings, 1 reply; 7+ messages in thread
From: Alexei Starovoitov @ 2026-03-06 2:26 UTC (permalink / raw)
To: Menglong Dong
Cc: Varun R Mallya, Andrii Nakryiko, Eduard,
Toke Høiland-Jørgensen, Alexei Starovoitov,
Daniel Borkmann, Song Liu, bpf,
open list:KERNEL SELFTEST FRAMEWORK, LKML
On Thu, Mar 5, 2026 at 5:40 PM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
>
> On Thu, Mar 5, 2026 at 5:16 PM Menglong Dong <menglong.dong@linux.dev> wrote:
> >
> > On 2026/3/6 06:21 Varun R Mallya <varunrmallya@gmail.com> write:
> > > Building selftests with
> > > clang 23.0.0 (6fae863eba8a72cdd82f37e7111a46a70be525e0) triggers
> > > the following error:
> > >
> > > tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c:117:12:
> > > error: assigning to 'char *' from 'const char *' discards qualifiers
> > > [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
> > >
> > > The variable `tgt_name` is declared as `char *`, but it stores the
> > > result of strstr(prog_name[i], "/"). Since `prog_name[i]` is a
> > > `const char *`, the returned pointer should also be treated as
> > > const-qualified.
> > >
> > > Update `tgt_name` to `const char *` to match the type of the underlying
> > > string and silence the compiler warning.
> > >
> > > Signed-off-by: Varun R Mallya <varunrmallya@gmail.com>
> > > ---
> > > tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
> > > index 23d933f1aec6..92c20803ea76 100644
> > > --- a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
> > > +++ b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
> > > @@ -111,7 +111,7 @@ static void test_fexit_bpf2bpf_common(const char *obj_file,
> > > struct bpf_link_info link_info;
> > > struct bpf_program *pos;
> > > const char *pos_sec_name;
> > > - char *tgt_name;
> > > + const char *tgt_name;
> >
> > I have been suffering from this build error too. So,
> >
> > Acked-by: Menglong Dong <menglong.dong@linux.dev>
>
> Looks like this patch was lost. Pls resend.
Ohh. I see it now. Your reply got delivered before the patch itself
and the patch went to spam.
No need to resend.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: Fix const qualifier warning in fexit_bpf2bpf.c
2026-03-06 2:26 ` Alexei Starovoitov
@ 2026-03-06 2:47 ` Menglong Dong
0 siblings, 0 replies; 7+ messages in thread
From: Menglong Dong @ 2026-03-06 2:47 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: Varun R Mallya, Andrii Nakryiko, Eduard,
Toke Høiland-Jørgensen, Alexei Starovoitov,
Daniel Borkmann, Song Liu, bpf,
open list:KERNEL SELFTEST FRAMEWORK, LKML
On 2026/3/6 10:26 Alexei Starovoitov <alexei.starovoitov@gmail.com> write:
> On Thu, Mar 5, 2026 at 5:40 PM Alexei Starovoitov
> <alexei.starovoitov@gmail.com> wrote:
> >
> > On Thu, Mar 5, 2026 at 5:16 PM Menglong Dong <menglong.dong@linux.dev> wrote:
> > >
> > > On 2026/3/6 06:21 Varun R Mallya <varunrmallya@gmail.com> write:
> > > > Building selftests with
> > > > clang 23.0.0 (6fae863eba8a72cdd82f37e7111a46a70be525e0) triggers
> > > > the following error:
> > > >
> > > > tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c:117:12:
> > > > error: assigning to 'char *' from 'const char *' discards qualifiers
> > > > [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
> > > >
> > > > The variable `tgt_name` is declared as `char *`, but it stores the
> > > > result of strstr(prog_name[i], "/"). Since `prog_name[i]` is a
> > > > `const char *`, the returned pointer should also be treated as
> > > > const-qualified.
> > > >
> > > > Update `tgt_name` to `const char *` to match the type of the underlying
> > > > string and silence the compiler warning.
> > > >
> > > > Signed-off-by: Varun R Mallya <varunrmallya@gmail.com>
> > > > ---
> > > > tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c | 2 +-
> > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
> > > > index 23d933f1aec6..92c20803ea76 100644
> > > > --- a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
> > > > +++ b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
> > > > @@ -111,7 +111,7 @@ static void test_fexit_bpf2bpf_common(const char *obj_file,
> > > > struct bpf_link_info link_info;
> > > > struct bpf_program *pos;
> > > > const char *pos_sec_name;
> > > > - char *tgt_name;
> > > > + const char *tgt_name;
> > >
> > > I have been suffering from this build error too. So,
> > >
> > > Acked-by: Menglong Dong <menglong.dong@linux.dev>
> >
> > Looks like this patch was lost. Pls resend.
>
> Ohh. I see it now. Your reply got delivered before the patch itself
> and the patch went to spam.
> No need to resend.
Okay!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: Fix const qualifier warning in fexit_bpf2bpf.c
2026-03-05 22:21 [PATCH bpf-next] selftests/bpf: Fix const qualifier warning in fexit_bpf2bpf.c Varun R Mallya
2026-03-06 1:16 ` Menglong Dong
@ 2026-03-06 12:11 ` Varun R Mallya
2026-03-11 18:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 7+ messages in thread
From: Varun R Mallya @ 2026-03-06 12:11 UTC (permalink / raw)
To: andrii, eddyz87, toke
Cc: ast, daniel, song, bpf, linux-kselftest, linux-kernel
Looks like the CI failed on this:
> CI has tested the following submission:
> Status: FAILURE
> Name: [bpf-next] selftests/bpf: Fix const qualifier warning in fexit_bpf2bpf.c
> Patchwork: https://patchwork.kernel.org/project/netdevbpf/list/?series=1062212&state=*
> Matrix: https://github.com/kernel-patches/bpf/actions/runs/22741682920
>
> Failed jobs:
> test_progs_parallel-x86_64-gcc-15: https://github.com/kernel-patches/bpf/actions/runs/22741682920/job/65957069283
>
>
The CI Failure seems to be unrelated, though:
```
With the provided path, there will be 109 files uploaded
Artifact name is valid!
Root directory input is valid!
Error: The path for one of the files in artifact is not valid:
/packets-135-10-net_timestamping__INET4:_bpf_timestamping-net_timestamping_ns.log.
Contains the following character: Colon :
Invalid characters include: Double quote ", Colon :, Less than <, Greater than >,
Vertical bar |, Asterisk *, Question mark ?, Carriage return \r, Line feed \n
The following characters are not allowed in files that are uploaded due to
limitations with certain file systems such as NTFS. To maintain file system
agnostic behavior, these characters are intentionally not allowed to prevent
potential problems with downloads on different file systems.
```
The selftests did pass.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: Fix const qualifier warning in fexit_bpf2bpf.c
2026-03-05 22:21 [PATCH bpf-next] selftests/bpf: Fix const qualifier warning in fexit_bpf2bpf.c Varun R Mallya
2026-03-06 1:16 ` Menglong Dong
2026-03-06 12:11 ` Varun R Mallya
@ 2026-03-11 18:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-11 18:20 UTC (permalink / raw)
To: Varun R Mallya
Cc: andrii, eddyz87, toke, ast, daniel, song, bpf, linux-kselftest,
linux-kernel
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:
On Fri, 6 Mar 2026 03:51:32 +0530 you wrote:
> Building selftests with
> clang 23.0.0 (6fae863eba8a72cdd82f37e7111a46a70be525e0) triggers
> the following error:
>
> tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c:117:12:
> error: assigning to 'char *' from 'const char *' discards qualifiers
> [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
>
> [...]
Here is the summary with links:
- [bpf-next] selftests/bpf: Fix const qualifier warning in fexit_bpf2bpf.c
https://git.kernel.org/bpf/bpf-next/c/ca0f39a369c5
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-03-11 18:20 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-05 22:21 [PATCH bpf-next] selftests/bpf: Fix const qualifier warning in fexit_bpf2bpf.c Varun R Mallya
2026-03-06 1:16 ` Menglong Dong
2026-03-06 1:40 ` Alexei Starovoitov
2026-03-06 2:26 ` Alexei Starovoitov
2026-03-06 2:47 ` Menglong Dong
2026-03-06 12:11 ` Varun R Mallya
2026-03-11 18:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox