[PATCH sched_ext/for-7.1] tools/sched_ext: Remove redundant SCX_ENQ_IMMED compat definition

From: Tejun Heo

Date: Thu Mar 26 2026 - 16:14:39 EST


compat.bpf.h defined a fallback SCX_ENQ_IMMED macro using
__COMPAT_ENUM_OR_ZERO(). After 6bf36c68b0a2 ("tools/sched_ext:
Regenerate autogen enum headers") added SCX_ENQ_IMMED to the autogen
headers, including both triggers -Wmacro-redefined warnings.

The autogen definition through const volatile __weak already resolves to
0 on older kernels, providing the same backward compatibility. Remove
the now-redundant compat fallback.

Fixes: 6bf36c68b0a2 ("tools/sched_ext: Regenerate autogen enum headers")
Link: https://lore.kernel.org/r/20260326100313.338388-1-zhaomzhao@xxxxxxx
Reported-by: Zhao Mengmeng <zhaomengmeng@xxxxxxxxxx>
Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
---
tools/sched_ext/include/scx/compat.bpf.h | 5 -----
1 file changed, 5 deletions(-)

diff --git a/tools/sched_ext/include/scx/compat.bpf.h b/tools/sched_ext/include/scx/compat.bpf.h
index 654b566bd94a..8977b5a2caa1 100644
--- a/tools/sched_ext/include/scx/compat.bpf.h
+++ b/tools/sched_ext/include/scx/compat.bpf.h
@@ -422,11 +422,6 @@ static inline void scx_bpf_dsq_reenq(u64 dsq_id, u64 reenq_flags)
scx_bpf_error("kernel too old to reenqueue foreign local or user DSQs");
}

-/*
- * v7.1: %SCX_ENQ_IMMED.
- */
-#define SCX_ENQ_IMMED __COMPAT_ENUM_OR_ZERO(enum scx_enq_flags, SCX_ENQ_IMMED)
-
/*
* Define sched_ext_ops. This may be expanded to define multiple variants for
* backward compatibility. See compat.h::SCX_OPS_LOAD/ATTACH().
--
2.53.0