Remove useless #[allow(lint)]

This commit is contained in:
Ruihan Li
2025-01-24 17:39:58 +08:00
committed by Tate, Hongliang Tian
parent b42d596ec4
commit b415538097
32 changed files with 1 additions and 51 deletions

View File

@ -42,7 +42,6 @@ use crate::{
};
#[derive(Debug, Clone, Copy)]
#[allow(dead_code)]
pub struct IommuVersion {
major: u8,
minor: u8,
@ -65,14 +64,12 @@ impl IommuVersion {
/// Important registers used by IOMMU.
#[derive(Debug)]
pub struct IommuRegisters {
#[allow(dead_code)]
version: Volatile<&'static u32, ReadOnly>,
capability: Volatile<&'static u64, ReadOnly>,
extended_capability: Volatile<&'static u64, ReadOnly>,
global_command: Volatile<&'static mut u32, WriteOnly>,
global_status: Volatile<&'static u32, ReadOnly>,
root_table_address: Volatile<&'static mut u64, ReadWrite>,
#[allow(dead_code)]
context_command: Volatile<&'static mut u64, ReadWrite>,
interrupt_remapping_table_addr: Volatile<&'static mut u64, ReadWrite>,

View File

@ -85,7 +85,6 @@ pub unsafe fn init(on_bsp: bool) {
// The linker script ensure that cpu_local_tss section is right
// at the beginning of cpu_local area, so that gsbase (offset zero)
// points to LOCAL_TSS.
#[allow(dead_code)]
#[link_section = ".cpu_local_tss"]
static LOCAL_TSS: SyncUnsafeCell<TaskStateSegment> = SyncUnsafeCell::new(TaskStateSegment::new());

View File

@ -216,7 +216,6 @@ impl<T: 'static + SingleInstructionBitXorAssign<T>> CpuLocalCell<T> {
///
/// Note that this memory operation will not be elided or reordered by the
/// compiler since it is a black-box.
#[allow(unused)]
pub fn bitxor_assign(&'static self, rhs: T) {
let offset = self as *const _ as usize - __cpu_local_start as usize;
// SAFETY: The CPU-local object is defined in the `.cpu_local` section,

View File

@ -114,7 +114,6 @@ pub trait SingleInstructionBitXorAssign<Rhs = Self> {
/// # Safety
///
/// Please refer to the module-level documentation of [`self`].
#[allow(unused)]
unsafe fn bitxor_assign(offset: *mut Self, rhs: Rhs);
}

View File

@ -210,7 +210,6 @@ impl<M: AnyFrameMeta + ?Sized> Frame<M> {
/// A physical address to the frame is returned in case the frame needs to be
/// restored using [`Frame::from_raw`] later. This is useful when some architectural
/// data structures need to hold the frame handle such as the page table.
#[allow(unused)]
pub(in crate::mm) fn into_raw(self) -> Paddr {
let paddr = self.start_paddr();
core::mem::forget(self);

View File

@ -258,7 +258,6 @@ impl Heap {
}
/// Returns total memory size in bytes of the heap.
#[allow(unused)]
pub fn total_bytes(&self) -> usize {
self.slab_64_bytes.total_blocks() * 64
+ self.slab_128_bytes.total_blocks() * 128
@ -271,7 +270,6 @@ impl Heap {
}
/// Returns allocated memory size in bytes.
#[allow(unused)]
pub fn used_bytes(&self) -> usize {
self.slab_64_bytes.used_blocks() * 64
+ self.slab_128_bytes.used_blocks() * 128

View File

@ -45,12 +45,10 @@ impl<const BLK_SIZE: usize> Slab<BLK_SIZE> {
}
}
#[allow(unused)]
pub fn total_blocks(&self) -> usize {
self.total_blocks
}
#[allow(unused)]
pub fn used_blocks(&self) -> usize {
self.total_blocks - self.free_block_list.len()
}

View File

@ -94,7 +94,6 @@ pub enum PageTableItem {
page: Frame<dyn AnyFrameMeta>,
prop: PageProperty,
},
#[allow(dead_code)]
MappedUntracked {
va: Vaddr,
pa: Paddr,

View File

@ -1,7 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use core::fmt::Debug;
use crate::{