Fix a bunch of warnings

This commit is contained in:
bjorn3
2026-03-11 22:03:35 +01:00
parent 49ef369fed
commit 9795abb0ea
15 changed files with 24 additions and 37 deletions
+2 -4
View File
@@ -1,5 +1,3 @@
use core::ptr;
use super::Io;
/// MMIO using pointer instead of wrapped type
@@ -35,11 +33,11 @@ where
type Value = T;
fn read(&self) -> T {
unsafe { ptr::read_volatile(self.ptr) }
unsafe { core::ptr::read_volatile(self.ptr) }
}
fn write(&mut self, value: T) {
unsafe { ptr::write_volatile(self.ptr, value) };
unsafe { core::ptr::write_volatile(self.ptr, value) };
}
}
+7 -11
View File
@@ -278,14 +278,12 @@ pub fn acquire_port_io_rights() -> Result<()> {
fn redox_cur_thrfd_v0() -> usize;
}
let kernel_fd = syscall::dup(unsafe { redox_cur_thrfd_v0() }, b"open_via_dup")?;
let res = unsafe {
libredox::call::call_wo(
kernel_fd,
&[],
syscall::CallFlags::empty(),
&[ProcSchemeVerb::Iopl as u64],
)
};
let res = libredox::call::call_wo(
kernel_fd,
&[],
syscall::CallFlags::empty(),
&[ProcSchemeVerb::Iopl as u64],
);
let _ = syscall::close(kernel_fd);
res?;
Ok(())
@@ -310,9 +308,7 @@ impl VirtaddrTranslationHandle {
/// Translate physical => virtual.
pub fn translate(&self, physical: usize) -> Result<usize> {
let mut buf = physical.to_ne_bytes();
unsafe {
libredox::call::call_ro(self.fd.raw(), &mut buf, syscall::CallFlags::empty(), &[])?;
}
libredox::call::call_ro(self.fd.raw(), &mut buf, syscall::CallFlags::empty(), &[])?;
Ok(usize::from_ne_bytes(buf))
}
}