* [PATCH -next] sched_ext: Fixes incorrect type in bpf_scx_init()
@ 2024-07-15 2:10 Jiapeng Chong
2024-07-15 4:43 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2024-07-15 2:10 UTC (permalink / raw)
To: tj
Cc: void, mingo, peterz, juri.lelli, vincent.guittot,
dietmar.eggemann, rostedt, bsegall, mgorman, vschneid,
linux-kernel, Jiapeng Chong, Abaci Robot
The type_id is defined as u32type, if(type_id<0) is invalid, hence
modified its type to s32.
./kernel/sched/ext.c:4958:5-12: WARNING: Unsigned expression compared with zero: type_id < 0.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9523
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
kernel/sched/ext.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index f4a7abcec793..7ddeaa43b63d 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -4952,7 +4952,7 @@ static void bpf_scx_unreg(void *kdata, struct bpf_link *link)
static int bpf_scx_init(struct btf *btf)
{
- u32 type_id;
+ s32 type_id;
type_id = btf_find_by_name_kind(btf, "task_struct", BTF_KIND_STRUCT);
if (type_id < 0)
--
2.20.1.7.g153144c
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH -next] sched_ext: Fixes incorrect type in bpf_scx_init()
2024-07-15 2:10 [PATCH -next] sched_ext: Fixes incorrect type in bpf_scx_init() Jiapeng Chong
@ 2024-07-15 4:43 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2024-07-15 4:43 UTC (permalink / raw)
To: Jiapeng Chong
Cc: void, mingo, peterz, juri.lelli, vincent.guittot,
dietmar.eggemann, rostedt, bsegall, mgorman, vschneid,
linux-kernel, Abaci Robot
On Mon, Jul 15, 2024 at 10:10:26AM +0800, Jiapeng Chong wrote:
> The type_id is defined as u32type, if(type_id<0) is invalid, hence
> modified its type to s32.
>
> ./kernel/sched/ext.c:4958:5-12: WARNING: Unsigned expression compared with zero: type_id < 0.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9523
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Applied to sched_ext/for-6.11.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-15 4:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-15 2:10 [PATCH -next] sched_ext: Fixes incorrect type in bpf_scx_init() Jiapeng Chong
2024-07-15 4:43 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®