diff --git a/framework/jinux-frame/src/arch/x86/iommu/mod.rs b/framework/jinux-frame/src/arch/x86/iommu/mod.rs index ecba35330..54b0631c2 100644 --- a/framework/jinux-frame/src/arch/x86/iommu/mod.rs +++ b/framework/jinux-frame/src/arch/x86/iommu/mod.rs @@ -27,7 +27,7 @@ pub enum IommuError { /// /// Mapping an incorrect address may lead to a kernel data leak. pub(crate) unsafe fn map(vaddr: Vaddr, paddr: Paddr) -> Result<(), IommuError> { - let Some(table) = PAGE_TABLE.get() else{ + let Some(table) = PAGE_TABLE.get() else { return Err(IommuError::NoIommu); }; // The page table of all devices is the same. So we can use any device ID. @@ -51,7 +51,7 @@ pub(crate) unsafe fn map(vaddr: Vaddr, paddr: Paddr) -> Result<(), IommuError> { } pub(crate) fn unmap(vaddr: Vaddr) -> Result<(), IommuError> { - let Some(table) = PAGE_TABLE.get() else{ + let Some(table) = PAGE_TABLE.get() else { return Err(IommuError::NoIommu); }; // The page table of all devices is the same. So we can use any device ID. diff --git a/framework/jinux-frame/src/bus/pci/common_device.rs b/framework/jinux-frame/src/bus/pci/common_device.rs index 4af6491c2..9b3f1e02d 100644 --- a/framework/jinux-frame/src/bus/pci/common_device.rs +++ b/framework/jinux-frame/src/bus/pci/common_device.rs @@ -88,7 +88,7 @@ pub struct BarManager { impl BarManager { /// Gain access to the BAR space and return None if that BAR is set to be invisible or absent. pub fn bar(&self, idx: u8) -> Option { - let Some((bar,visible)) = self.bars[idx as usize].clone() else{ + let Some((bar, visible)) = self.bars[idx as usize].clone() else { return None; }; if visible { @@ -132,12 +132,12 @@ impl BarManager { pub(super) fn set_invisible(&mut self, idx: u8) { if self.bars[idx as usize].is_some() { - let Some((bar,_)) = self.bars[idx as usize].clone() else{ + let Some((bar, _)) = self.bars[idx as usize].clone() else { return; }; self.bars[idx as usize] = Some((bar, false)); } - let Some((_,visible)) = self.bars[idx as usize] else{ + let Some((_, visible)) = self.bars[idx as usize] else { return; }; } diff --git a/framework/jinux-frame/src/bus/pci/mod.rs b/framework/jinux-frame/src/bus/pci/mod.rs index d8a7c9aee..f733fb6c2 100644 --- a/framework/jinux-frame/src/bus/pci/mod.rs +++ b/framework/jinux-frame/src/bus/pci/mod.rs @@ -64,7 +64,7 @@ pub static PCI_BUS: Mutex = Mutex::new(PciBus::new()); pub(crate) fn init() { let mut lock = PCI_BUS.lock(); for location in PciDeviceLocation::all() { - let Some(device) = PciCommonDevice::new(location)else{ + let Some(device) = PciCommonDevice::new(location) else { continue; }; lock.register_common_device(device); diff --git a/services/comps/pci/src/lib.rs b/services/comps/pci/src/lib.rs index 44cd4bb93..626a739ce 100644 --- a/services/comps/pci/src/lib.rs +++ b/services/comps/pci/src/lib.rs @@ -45,7 +45,7 @@ impl PCIComponent { pub fn init() -> Result { let mut devices = Vec::new(); for location in PciDeviceLocation::all() { - let Some(device) = util::find_device(location,CSpaceAccessMethod::IO) else{ + let Some(device) = util::find_device(location, CSpaceAccessMethod::IO) else { continue; }; log::info!(