Skip to content

Commit 7724abf

Browse files
committed
sched_ext: Make cast_mask() inline
cast_mask() doesn't do any actual work and is defined in a header file. Force it to be inline. When it is not inlined and the function is not used, it can cause verificaiton failures like the following: # tools/testing/selftests/sched_ext/runner -t minimal ===== START ===== TEST: minimal DESCRIPTION: Verify we can load a fully minimal scheduler OUTPUT: libbpf: prog 'cast_mask': missing BPF prog type, check ELF section name '.text' libbpf: prog 'cast_mask': failed to load: -22 libbpf: failed to load object 'minimal' libbpf: failed to load BPF skeleton 'minimal': -22 ERR: minimal.c:20 Failed to open and load skel not ok 1 minimal # ===== END ===== Signed-off-by: Tejun Heo <[email protected]> Fixes: a748db0 ("tools/sched_ext: Receive misc updates from SCX repo")
1 parent 0e7ffff commit 7724abf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/sched_ext/include/scx/common.bpf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ u32 bpf_cpumask_weight(const struct cpumask *cpumask) __ksym;
320320
/*
321321
* Access a cpumask in read-only mode (typically to check bits).
322322
*/
323-
const struct cpumask *cast_mask(struct bpf_cpumask *mask)
323+
static __always_inline const struct cpumask *cast_mask(struct bpf_cpumask *mask)
324324
{
325325
return (const struct cpumask *)mask;
326326
}

0 commit comments

Comments
 (0)