Fix clippy warnings in kernel crate

This commit is contained in:
jiangjianfeng
2025-06-06 07:06:30 +00:00
committed by Tate, Hongliang Tian
parent 81ba3b645b
commit f0957d2f54
42 changed files with 91 additions and 94 deletions

View File

@ -183,9 +183,9 @@ pub(super) fn access_sched_attr_with<T>(
f: impl FnOnce(&SchedAttr) -> Result<T>,
) -> Result<T> {
match tid {
0 => f(&ctx.thread.sched_attr()),
0 => f(ctx.thread.sched_attr()),
_ if tid > (i32::MAX as u32) => Err(Error::with_message(Errno::EINVAL, "invalid tid")),
_ => f(&thread_table::get_thread(tid)
_ => f(thread_table::get_thread(tid)
.ok_or_else(|| Error::with_message(Errno::ESRCH, "thread does not exist"))?
.sched_attr()),
}