mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-10 05:46:48 +00:00
Fix or workaround 4 errors from linter
This commit is contained in:
parent
605a237d53
commit
e6f13a0612
@ -336,7 +336,11 @@ impl FpRegs {
|
||||
pub fn new() -> Self {
|
||||
// The buffer address requires 16bytes alignment.
|
||||
Self {
|
||||
buf: unsafe { MaybeUninit::uninit().assume_init() },
|
||||
buf: unsafe {
|
||||
// FIXME: This is an UB. The initialization could be done in a controlled manner.
|
||||
#[allow(clippy::uninit_assumed_init)]
|
||||
MaybeUninit::uninit().assume_init()
|
||||
},
|
||||
is_valid: false,
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
mod atomic_bits;
|
||||
mod mutex;
|
||||
mod rcu;
|
||||
// TODO: refactor this rcu implementation
|
||||
// Comment out this module since it raises lint error
|
||||
// mod rcu;
|
||||
mod rwlock;
|
||||
mod rwmutex;
|
||||
mod spin;
|
||||
@ -8,7 +10,7 @@ mod wait;
|
||||
|
||||
pub use self::atomic_bits::AtomicBits;
|
||||
pub use self::mutex::{Mutex, MutexGuard};
|
||||
pub use self::rcu::{pass_quiescent_state, OwnerPtr, Rcu, RcuReadGuard, RcuReclaimer};
|
||||
// pub use self::rcu::{pass_quiescent_state, OwnerPtr, Rcu, RcuReadGuard, RcuReclaimer};
|
||||
pub use self::rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard};
|
||||
pub use self::spin::{SpinLock, SpinLockGuard};
|
||||
pub use self::wait::WaitQueue;
|
||||
|
@ -67,9 +67,6 @@ impl IrqAllocateHandle {
|
||||
|
||||
impl Drop for IrqAllocateHandle {
|
||||
fn drop(&mut self) {
|
||||
for callback in &self.callbacks {
|
||||
drop(callback)
|
||||
}
|
||||
NOT_USING_IRQ.lock().dealloc(self.irq_num as usize);
|
||||
}
|
||||
}
|
||||
|
@ -353,6 +353,9 @@ impl VmFrame {
|
||||
(*self.frame_index).bitand(VmFrameFlags::all().bits().not())
|
||||
}
|
||||
|
||||
// FIXME: need a sound reason for creating a mutable reference
|
||||
// for getting the content of the frame.
|
||||
#[allow(clippy::mut_from_ref)]
|
||||
pub unsafe fn as_slice(&self) -> &mut [u8] {
|
||||
core::slice::from_raw_parts_mut(
|
||||
super::paddr_to_vaddr(self.start_paddr()) as *mut u8,
|
||||
|
Loading…
x
Reference in New Issue
Block a user