Skip to contentSkip to conversation

selftests/seccomp: Fixed type mismatch warning

PATCH New Alessandro Zanni 1 participant 1 message Oct 29, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/seccomp: Fixed type mismatch warning

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

---
 tools/testing/selftests/seccomp/seccomp_bpf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/seccomp/seccomp_bpf.c +2 -1
index 874f17763536..cd745a8a5b7e 100644
@@ -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)
Signature · 1 line
2.43.0