diff --git a/kernel/src/arch/riscv/process.rs b/kernel/src/arch/riscv/process.rs index 5b43f94d0..291ba6a0d 100644 --- a/kernel/src/arch/riscv/process.rs +++ b/kernel/src/arch/riscv/process.rs @@ -378,7 +378,7 @@ impl Process { // println!("Setting up thread {}, pid {}", new_tid, pid); let sp = setup.stack.as_ptr() as usize + setup.stack.len(); if sp <= 16 { - Err(xous_kernel::Error::BadAddress)?; + return Err(xous_kernel::Error::BadAddress); } crate::arch::syscall::invoke( thread, @@ -403,7 +403,7 @@ impl Process { // Ensure this thread is valid if thread.sepc == 0 || tid == IRQ_TID { - Err(xous_kernel::Error::ThreadNotAvailable)?; + return Err(xous_kernel::Error::ThreadNotAvailable); } // thread.registers[0] == x1 @@ -425,7 +425,6 @@ impl Process { pub fn print_all_threads(&self) { let process = unsafe { &mut *PROCESS }; - &mut process.threads[process.hardware_thread - 1]; for (tid_idx, &thread) in process.threads.iter().enumerate() { let tid = tid_idx + 1; if thread.registers[1] != 0 { @@ -437,7 +436,7 @@ impl Process { pub fn print_current_thread(&self) { let thread = self.current_thread(); let tid = self.current_tid(); - Self::print_thread(tid, &thread); + Self::print_thread(tid, thread); } pub fn print_thread(_tid: TID, _thread: &Thread) {