From 8eb359ee42d55f01ac706eb03a30cd684a0c12b6 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Mon, 9 Oct 2023 11:50:47 +0800 Subject: [PATCH] cargo fmt --- src/libksupport/src/kernel/subkernel.rs | 4 ++-- src/runtime/src/comms.rs | 5 ++++- src/runtime/src/rtio_mgt.rs | 18 ++++++++++++------ src/satman/src/main.rs | 4 +--- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/libksupport/src/kernel/subkernel.rs b/src/libksupport/src/kernel/subkernel.rs index f168a99d..93032278 100644 --- a/src/libksupport/src/kernel/subkernel.rs +++ b/src/libksupport/src/kernel/subkernel.rs @@ -81,12 +81,12 @@ pub extern "C" fn await_message(id: u32, timeout: u64, min: u8, max: u8) { match unsafe { KERNEL_CHANNEL_0TO1.as_mut().unwrap() }.recv() { Message::SubkernelMsgRecvReply { status: SubkernelStatus::NoError, - count + count, } => { if min > count || count > max { artiq_raise!("SubkernelError", "Received more or less arguments than required") } - }, + } Message::SubkernelMsgRecvReply { status: SubkernelStatus::IncorrectState, .. diff --git a/src/runtime/src/comms.rs b/src/runtime/src/comms.rs index 4c7974e5..0df0defc 100644 --- a/src/runtime/src/comms.rs +++ b/src/runtime/src/comms.rs @@ -463,7 +463,10 @@ async fn handle_run_kernel( control .borrow_mut() .tx - .async_send(kernel::Message::SubkernelMsgRecvReply { status: status, count: count }) + .async_send(kernel::Message::SubkernelMsgRecvReply { + status: status, + count: count, + }) .await; if let Ok(message) = message_received { // receive code almost identical to RPC recv, except we are not reading from a stream diff --git a/src/runtime/src/rtio_mgt.rs b/src/runtime/src/rtio_mgt.rs index 3b3f897c..f7d2671f 100644 --- a/src/runtime/src/rtio_mgt.rs +++ b/src/runtime/src/rtio_mgt.rs @@ -294,8 +294,14 @@ pub mod drtio { match reply { Ok(Packet::DestinationDownReply) => { destination_set_up(routing_table, up_destinations, destination, false).await; - remote_dma::destination_changed(aux_mutex, routing_table, timer, destination, false) - .await; + remote_dma::destination_changed( + aux_mutex, + routing_table, + timer, + destination, + false, + ) + .await; subkernel::destination_changed(aux_mutex, routing_table, timer, destination, false) .await; } @@ -327,11 +333,11 @@ pub mod drtio { ); unsafe { SEEN_ASYNC_ERRORS |= ASYNC_ERROR_BUSY }; } - Ok(packet) => { - match process_async_packets(aux_mutex, linkno, packet).await { - Some(packet) => error!("[DEST#{}] received unexpected aux packet: {:?}", destination, packet), - None => continue + Ok(packet) => match process_async_packets(aux_mutex, linkno, packet).await { + Some(packet) => { + error!("[DEST#{}] received unexpected aux packet: {:?}", destination, packet) } + None => continue, }, Err(e) => error!("[DEST#{}] communication failed ({})", destination, e), } diff --git a/src/satman/src/main.rs b/src/satman/src/main.rs index 9c73ca34..99683bfe 100644 --- a/src/satman/src/main.rs +++ b/src/satman/src/main.rs @@ -118,9 +118,7 @@ fn process_aux_packet( drtioaux::send(0, &drtioaux::Packet::ResetAck) } - drtioaux::Packet::DestinationStatusRequest { - destination, - } => { + drtioaux::Packet::DestinationStatusRequest { destination } => { #[cfg(has_drtio_routing)] let hop = _routing_table.0[destination as usize][*_rank as usize]; #[cfg(not(has_drtio_routing))]