From: Alessandro Zanni <alessandro.zanni87@gmail.com>
To: kees@kernel.org, luto@amacapital.net, wad@chromium.org, shuah@kernel.org
Cc: Alessandro Zanni <alessandro.zanni87@gmail.com>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] selftests/seccomp: Fixed type mismatch warning
Date: Wed, 29 Oct 2025 18:42:28 +0100 [thread overview]
Message-ID: <20251029174230.17184-1-alessandro.zanni87@gmail.com> (raw)
Forced cast of the variable passed to the get_uprobe_offset()
function either probed_uretprobe or probed_uprobe.
The solved warning is as follows:
CC seccomp_bpf
seccomp_bpf.c: In function ‘UPROBE_setup’:
seccomp_bpf.c:5175:74: warning: pointer type mismatch in conditional expression
5175 | offset = get_uprobe_offset(variant->uretprobe ? probed_uretprobe : probed_uprobe);
|
Command to test it:
make -C tools/testing/selftests TARGETS=seccomp
Signed-off-by: Alessandro Zanni <alessandro.zanni87@gmail.com>
---
tools/testing/selftests/seccomp/seccomp_bpf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
index 874f17763536..cd745a8a5b7e 100644
--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
+++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
@@ -5172,7 +5172,8 @@ FIXTURE_SETUP(UPROBE)
ASSERT_GE(bit, 0);
}
- offset = get_uprobe_offset(variant->uretprobe ? probed_uretprobe : probed_uprobe);
+ offset = get_uprobe_offset(variant->uretprobe
+ ? (void *)probed_uretprobe : (void *)probed_uprobe);
ASSERT_GE(offset, 0);
if (variant->uretprobe)
--
2.43.0
reply other threads:[~2025-10-29 17:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20251029174230.17184-1-alessandro.zanni87@gmail.com \
--to=alessandro.zanni87@gmail.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=shuah@kernel.org \
--cc=wad@chromium.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