public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Woojin Ji <random6.xyz@gmail.com>
To: bpf@vger.kernel.org, linux-kselftest@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, ast@kernel.org,
	daniel@iogearbox.net, andrii@kernel.org, shuah@kernel.org,
	Woojin Ji <random6.xyz@gmail.com>
Subject: [PATCH] selftests/bpf: fix const qualifier in fexit_bpf2bpf test
Date: Thu,  9 Apr 2026 18:11:01 +0900	[thread overview]
Message-ID: <20260409091101.364091-1-random6.xyz@gmail.com> (raw)

prog_name is an array of const char * strings, so strstr() returns a
pointer into const data.

Store the result in a const char * to avoid discarding the const
qualifier.

With GCC 15 this triggers -Werror=discarded-qualifiers and breaks
the build of tools/testing/selftests/bpf.

Signed-off-by: Woojin Ji <random6.xyz@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 f29fc789c14b..d8225da4c1af 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


             reply	other threads:[~2026-04-09  9:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09  9:11 Woojin Ji [this message]
2026-04-09 10:20 ` [PATCH] selftests/bpf: fix const qualifier in fexit_bpf2bpf test Jiayuan Chen
2026-04-09 14:40   ` Woojin Ji

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260409091101.364091-1-random6.xyz@gmail.com \
    --to=random6.xyz@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox