From 89a29f4e56b834dc9c99397cee90f916c3b5ae13 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Mon, 6 Apr 2026 15:05:54 +0200 Subject: [PATCH] Reduce usage of wildcard imports --- src/arch/x86/interrupt/handler.rs | 10 +++------- src/arch/x86_64/alternative.rs | 2 +- src/arch/x86_64/interrupt/handler.rs | 4 +--- src/scheme/irq.rs | 2 +- src/scheme/sys/mod.rs | 2 +- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/arch/x86/interrupt/handler.rs b/src/arch/x86/interrupt/handler.rs index 59d9caadce..aa7353d9f9 100644 --- a/src/arch/x86/interrupt/handler.rs +++ b/src/arch/x86/interrupt/handler.rs @@ -1,8 +1,4 @@ -use core::mem; - -use crate::{memory::ArchIntCtx, panic, syscall::IntRegisters}; - -use super::super::flags::*; +use crate::{arch::flags::FLAG_SINGLESTEP, memory::ArchIntCtx, panic, syscall::IntRegisters}; #[derive(Default)] #[repr(C, packed)] @@ -121,8 +117,8 @@ impl InterruptStack { if self.iret.cs & CPL_MASK == cs & CPL_MASK { // Privilege ring didn't change, so neither did the stack all.esp = self as *const Self as usize // esp after Self was pushed to the stack - + mem::size_of::() // disregard Self - - mem::size_of::() * 2; // well, almost: esp and ss need to be excluded as they aren't present + + size_of::() // disregard Self + - size_of::() * 2; // well, almost: esp and ss need to be excluded as they aren't present unsafe { core::arch::asm!("mov {}, ss", out(reg) all.ss); } diff --git a/src/arch/x86_64/alternative.rs b/src/arch/x86_64/alternative.rs index be89183bbd..43142809e9 100644 --- a/src/arch/x86_64/alternative.rs +++ b/src/arch/x86_64/alternative.rs @@ -284,7 +284,7 @@ pub fn features() -> KcpuFeatures { #[cfg(not(cpu_feature_never = "xsave"))] mod xsave { - use super::*; + use spin::Once; #[derive(Debug)] pub struct XsaveInfo { diff --git a/src/arch/x86_64/interrupt/handler.rs b/src/arch/x86_64/interrupt/handler.rs index 46b8051a06..ec2f2d12d4 100644 --- a/src/arch/x86_64/interrupt/handler.rs +++ b/src/arch/x86_64/interrupt/handler.rs @@ -1,6 +1,4 @@ -use crate::{memory::ArchIntCtx, panic, syscall::IntRegisters}; - -use super::super::flags::*; +use crate::{arch::flags::FLAG_SINGLESTEP, memory::ArchIntCtx, panic, syscall::IntRegisters}; #[derive(Default)] #[repr(C)] diff --git a/src/scheme/irq.rs b/src/scheme/irq.rs index 90b636acec..92efd9bbe1 100644 --- a/src/scheme/irq.rs +++ b/src/scheme/irq.rs @@ -106,7 +106,7 @@ impl IrqScheme { feature = "acpi", any(target_arch = "x86", target_arch = "x86_64") )) { - use crate::acpi::madt::*; + use crate::acpi::madt::{madt, MadtEntry}; match madt() { Some(madt) => madt diff --git a/src/scheme/sys/mod.rs b/src/scheme/sys/mod.rs index 8ca47e85f4..413217a64c 100644 --- a/src/scheme/sys/mod.rs +++ b/src/scheme/sys/mod.rs @@ -59,6 +59,7 @@ enum Kind { Rd(fn(&mut CleanLockToken) -> Result>), Wr(fn(&[u8], &mut CleanLockToken) -> Result), } +use Kind::{Rd, Wr}; impl Kind { fn generate_data(&self, token: &mut CleanLockToken) -> Result> { match self { @@ -67,7 +68,6 @@ impl Kind { } } } -use Kind::*; /// System information scheme pub struct SysScheme;