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

@ -31,7 +31,6 @@
#![feature(fn_traits)]
#![feature(step_trait)]
#![feature(trait_upcasting)]
#![allow(dead_code)]
extern crate alloc;

View File

@ -117,7 +117,6 @@ impl<'a> CurrentTx<'a> {
///
/// In addition, the `get_current_mut_with` method must _not_ be called
/// recursively.
#[allow(dropping_references)]
fn get_current_mut_with<F, R>(&self, f: F) -> R
where
F: FnOnce(&mut Tx) -> R,

View File

@ -60,7 +60,6 @@ pub struct Taskless {
/// The function that will be called when executing this taskless job.
callback: Box<RefCell<dyn FnMut() + Send + Sync + 'static>>,
/// Whether this `Taskless` is disabled.
#[allow(unused)]
is_disabled: AtomicBool,
link: LinkedListAtomicLink,
}
@ -74,7 +73,6 @@ cpu_local! {
impl Taskless {
/// Creates a new `Taskless` instance with its callback function.
#[allow(unused)]
pub fn new<F>(callback: F) -> Arc<Self>
where
F: FnMut() + Send + Sync + 'static,
@ -95,7 +93,6 @@ impl Taskless {
/// Schedules this taskless job and it will be executed in later time.
///
/// If the taskless job has been scheduled, this function will do nothing.
#[allow(unused)]
pub fn schedule(self: &Arc<Self>) {
do_schedule(self, &TASKLESS_LIST);
SoftIrqLine::get(TASKLESS_SOFTIRQ_ID).raise();
@ -105,7 +102,6 @@ impl Taskless {
/// in softirq context.
///
/// If the taskless job has been scheduled, this function will do nothing.
#[allow(unused)]
pub fn schedule_urgent(self: &Arc<Self>) {
do_schedule(self, &TASKLESS_URGENT_LIST);
SoftIrqLine::get(TASKLESS_URGENT_SOFTIRQ_ID).raise();
@ -114,20 +110,17 @@ impl Taskless {
/// Enables this `Taskless` so that it can be executed once it has been scheduled.
///
/// A new `Taskless` is enabled by default.
#[allow(unused)]
pub fn enable(&self) {
self.is_disabled.store(false, Ordering::Release);
}
/// Disables this `Taskless` so that it can not be scheduled. Note that if the `Taskless`
/// has been scheduled, it can still continue to complete this job.
#[allow(unused)]
pub fn disable(&self) {
self.is_disabled.store(true, Ordering::Release);
}
}
#[allow(unused)]
fn do_schedule(
taskless: &Arc<Taskless>,
taskless_list: &'static CpuLocal<RefCell<LinkedList<TasklessAdapter>>>,

View File

@ -118,7 +118,6 @@ impl VirtioVsockHdr {
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, TryFromInt)]
#[repr(u16)]
#[allow(non_camel_case_types)]
pub enum VirtioVsockOp {
#[default]
Invalid = 0,

View File

@ -7,7 +7,6 @@ use ostd::mm::{DmaCoherent, DmaStream, DmaStreamSlice, HasDaddr};
///
/// Any type implements this trait should also implements `HasDaddr` trait,
/// and provides the exact length of DMA area.
#[allow(clippy::len_without_is_empty)]
pub trait DmaBuf: HasDaddr {
/// The length of Dma area, in bytes
fn len(&self) -> usize;

View File

@ -73,7 +73,6 @@
//! ```
#![feature(proc_macro_diagnostic)]
#![allow(dead_code)]
use require_item::RequireItem;
use syn::parse_macro_input;

View File

@ -152,7 +152,6 @@ pub fn define_atomic_version_of_integer_like_type(input: TokenStream) -> TokenSt
}
};
let fn_swap = quote! {
#[allow(dead_code)]
pub fn swap(
&self,
val: impl Into<#integer_like_type>,
@ -162,7 +161,6 @@ pub fn define_atomic_version_of_integer_like_type(input: TokenStream) -> TokenSt
}
};
let fn_compare_exchange = quote! {
#[allow(dead_code)]
pub fn compare_exchange(
&self,
current: impl Into<#integer_like_type>,
@ -182,7 +180,6 @@ pub fn define_atomic_version_of_integer_like_type(input: TokenStream) -> TokenSt
}
};
let fn_fetch_update = quote! {
#[allow(dead_code)]
pub fn fetch_update<F>(
&self,
set_order: core::sync::atomic::Ordering,

View File

@ -3,7 +3,6 @@
//This crate defines the component system related macros.
#![feature(proc_macro_diagnostic)]
#![allow(dead_code)]
#![deny(unsafe_code)]
mod init_comp;

View File

@ -58,7 +58,6 @@ const EXFAT_UNUSED: u8 = 0x00;
#[allow(dead_code)]
const EXFAT_INVAL: u8 = 0x80;
const EXFAT_BITMAP: u8 = 0x81;
#[allow(dead_code)]
const EXFAT_UPCASE: u8 = 0x82;
#[allow(dead_code)]
const EXFAT_VOLUME: u8 = 0x83;

View File

@ -1,7 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use super::{inode::MAX_FNAME_LEN, prelude::*};
/// The data structure in a directory's data block. It is stored in a linked list.

View File

@ -109,7 +109,6 @@ struct RamInode {
}
/// Inode inner specifics.
#[allow(clippy::large_enum_variant)]
enum Inner {
Dir(RwLock<DirEntry>),
File(PageCache),

View File

@ -41,7 +41,6 @@ pub enum IpcControlCmd {
}
#[derive(Debug)]
#[allow(dead_code)]
pub struct IpcPermission {
key: key_t,
/// Owner's UID

View File

@ -1,5 +1,4 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(non_camel_case_types)]
use crate::{prelude::*, process::Pid};

View File

@ -1,7 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use aster_rights::{Dup, Read, TRights, Write};
use aster_rights_proc::require;
use ostd::sync::{PreemptDisabled, RwLockReadGuard, RwLockWriteGuard};

View File

@ -1,7 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use core::sync::atomic::{AtomicU32, Ordering};
use aster_rights::{ReadOp, WriteOp};

View File

@ -171,7 +171,6 @@ impl Process {
Some(Task::current()?.as_posix_thread()?.process())
}
#[allow(clippy::too_many_arguments)]
fn new(
pid: Pid,
parent: Weak<Process>,

View File

@ -1,7 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
//! This module is used to parse elf file content to get elf_load_info.
//! When create a process from elf file, we will use the elf_load_info to construct the VmSpace

View File

@ -21,7 +21,6 @@ use super::{
};
use crate::{prelude::*, thread::Thread};
#[allow(unused)]
pub fn init() {
let preempt_scheduler = Box::new(PreemptScheduler::default());
let scheduler = Box::<PreemptScheduler<Thread, Task>>::leak(preempt_scheduler);

View File

@ -237,7 +237,6 @@ impl MMapOptions {
self.typ
}
#[allow(unused)]
pub fn flags(&self) -> MMapFlags {
self.flags
}

View File

@ -75,7 +75,6 @@ fn set_new_stack(sig_stack_addr: Vaddr, old_stack: Option<&SigStack>, ctx: &Cont
Ok(())
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, Pod)]
#[repr(C)]
struct stack_t {

View File

@ -13,7 +13,6 @@ use crate::{current_userspace, net::socket::SocketAddr, prelude::*};
#[repr(i32)]
#[derive(Debug, Clone, Copy, TryFromInt, PartialEq, Eq)]
#[allow(non_camel_case_types)]
#[allow(dead_code)]
pub enum CSocketAddrFamily {
AF_UNSPEC = 0,
/// Unix domain sockets

View File

@ -46,10 +46,7 @@ where
let mut bytes: [u8; CSocketAddrUnix::MAX_LEN + 1] = Pod::new_zeroed();
bytes[..2].copy_from_slice(&(CSocketAddrFamily::AF_UNIX as u16).to_ne_bytes());
#[allow(clippy::assertions_on_constants)]
const {
assert!(CSocketAddrUnix::PATH_OFFSET == 2)
};
const { assert!(CSocketAddrUnix::PATH_OFFSET == 2) };
let sun_path = &mut bytes[CSocketAddrUnix::PATH_OFFSET..];

View File

@ -36,7 +36,6 @@ where
}
}
#[allow(dead_code)]
impl<K, V> IntervalSet<K, V>
where
K: Clone + Ord,