From 4abaae000bfeba58106f2da049a3c8b1bf1fe637 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Fri, 17 Jul 2026 03:31:40 +0700 Subject: [PATCH] nvmed: Use correct TimeSpec for timeout --- drivers/storage/nvmed/src/main.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/storage/nvmed/src/main.rs b/drivers/storage/nvmed/src/main.rs index 658af32731..acf0953b2f 100644 --- a/drivers/storage/nvmed/src/main.rs +++ b/drivers/storage/nvmed/src/main.rs @@ -40,19 +40,14 @@ impl Disk for NvmeDisk { } fn time_arm(time_handle: &mut File, secs: i64) -> io::Result<()> { - let mut time_buf = [0_u8; core::mem::size_of::()]; + let mut time_buf = syscall::TimeSpec::default(); if time_handle.read(&mut time_buf)? < time_buf.len() { return Err(io::Error::new( io::ErrorKind::InvalidData, "time read too small", )); } - - match libredox::data::timespec_from_mut_bytes(&mut time_buf) { - time => { - time.tv_sec += secs; - } - } + time_buf.tv_sec += secs; time_handle.write(&time_buf)?; Ok(()) }