diff options
| author | Liang Luo <luoliang@kylinos.cn> | 2026-06-26 17:59:28 +0800 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-06-26 12:04:33 -1000 |
| commit | 0cfd929fba41c8500c26068365de33274591e82d (patch) | |
| tree | 011bce1e7579ecf48d03b0d16e2059f322248308 /tools/perf/scripts/python | |
| parent | e2c60e15d0803d58d757dbfa5db6e528571248a5 (diff) | |
tools/sched_ext: fix getopt() option variable signedness
Four example schedulers (scx_simple, scx_cpu0, scx_sdt, scx_userland)
declare the variable that holds getopt()'s return value as __u32.
getopt() returns int and uses -1 to mark end-of-options; storing that
sentinel in an unsigned variable turns it into 0xffffffff, and the
subsequent 'opt != -1' test only happens to keep working because both
operands of != are promoted to the same 0xffffffff.
Declare the variable as __s32 instead, matching getopt()'s actual
contract and the style already used in scx_qmap.c (int opt) and
scx_pair/central/flatcg.c (__s32 opt). This also silences the
-Wsign-compare warnings emitted for the affected files.
Signed-off-by: Liang Luo <luoliang@kylinos.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
