Allow dead_code and unused_variables at file level

This commit is contained in:
Ruihan Li
2024-06-04 02:34:33 +08:00
committed by Tate, Hongliang Tian
parent 232e62b053
commit 9107a1771e
139 changed files with 305 additions and 0 deletions

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use alloc::{fmt, sync::Arc, vec::Vec};
use core::fmt::Write;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use acpi::{fadt::Fadt, sdt::Signature};
use x86_64::instructions::port::{ReadOnlyAccess, WriteOnlyAccess};

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use alloc::collections::BTreeMap;
use core::mem::size_of;

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use alloc::vec::Vec;
use core::fmt::Debug;

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use bitflags::bitflags;
use log::debug;
use spin::Once;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::ops::Range;
use pod::Pod;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use alloc::{boxed::Box, fmt::Debug, sync::Arc, vec::Vec};
use id_alloc::IdAlloc;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use alloc::vec::Vec;
use core::{fmt::Debug, mem::size_of, slice::Iter};

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
pub mod dmar;
pub mod remapping;

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
//! Remapping structures of DMAR table.
//! This file defines these structures and provides a "Debug" implementation to see the value inside these structures.
//! Most of the introduction are copied from Intel vt-directed-io-specification.

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use alloc::{vec, vec::Vec};
#[cfg(feature = "intel_tdx")]

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use alloc::sync::Arc;
use log::info;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use spin::Once;
use x86::apic::xapic;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use core::sync::atomic::{AtomicBool, AtomicU8, Ordering::Relaxed};
use log::info;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::{
arch::x86_64::_rdtsc,
sync::atomic::{AtomicBool, AtomicU64, Ordering},

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use alloc::sync::Arc;
use core::{
arch::x86_64::_rdtsc,

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use alloc::vec::Vec;
use acpi::{AcpiError, HpetInfo};

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
//! The Programmable Interval Timer (PIT) chip (Intel 8253/8254) basically consists of an oscillator,
//! a prescaler and 3 independent frequency dividers. Each frequency divider has an output, which is
//! used to allow the timer to control external circuitry (for example, IRQ 0).

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
//! The module to parse kernel command-line arguments.
//!
//! The format of the Asterinas command line string conforms

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
//! The architecture-independent boot module, which provides a universal interface
//! from the bootloader to the rest of the framework.
//!

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use alloc::{collections::VecDeque, fmt::Debug, sync::Arc, vec::Vec};
use log::{debug, error};

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
//! Virtio over MMIO
pub mod bus;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use alloc::{collections::VecDeque, sync::Arc, vec::Vec};
use core::fmt::Debug;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use alloc::vec::Vec;
use self::{msix::CapabilityMsixData, vendor::CapabilityVndrData};

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use alloc::{sync::Arc, vec::Vec};
#[cfg(feature = "intel_tdx")]

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use alloc::vec::Vec;
use super::{

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::marker::PhantomData;
use align_ext::AlignExt;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
//! Kernel memory space management.
//!
//! The kernel memory space is currently managed as follows, if the

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
//! Virtual memory (VM).
/// Virtual addresses.

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
//! Metadata management of pages.
//!
//! You can picture a globally shared, static, gigantic arrary of metadata initialized for each page.

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
//! Physical memory page management.
//!
//! A page is an aligned, contiguous range of bytes in physical memory. The sizes

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
//! The page table cursor for mapping and querying over the page table.
//!
//! ## The page table lock protocol

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use core::{fmt::Debug, marker::PhantomData, ops::Range};
use pod::Pod;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
//! This module defines page table node abstractions and the handle.
//!
//! The page table node is also frequently referred to as a page table in many architectural

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::{
fmt::{self},
sync::atomic::{AtomicU64, Ordering::Relaxed},

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use alloc::sync::Arc;
use core::{
cell::UnsafeCell,

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use alloc::sync::Arc;
use core::{
cell::UnsafeCell,

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use alloc::sync::Arc;
use core::{
cell::RefCell,

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use alloc::collections::VecDeque;
use lazy_static::lazy_static;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use core::cell::UnsafeCell;
use intrusive_collections::{intrusive_adapter, LinkedListAtomicLink};

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use alloc::boxed::Box;
use core::sync::atomic::{AtomicBool, AtomicU8, Ordering};

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
//! User space.
use trapframe::TrapFrame;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use super::*;
use crate::{events::IoEvents, fs::inode_handle::FileIo, prelude::*, process::signal::Poller};

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use crate::{
events::IoEvents,
fs::{

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use crate::{
events::IoEvents,
fs::{

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
pub use aster_frame::arch::console;
use aster_frame::mm::VmReader;
use spin::Once;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use alloc::format;
use aster_frame::trap::{disable_local, in_interrupt_context};

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use aster_frame::early_print;
use spin::Once;

View File

@ -1,5 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(non_camel_case_types)]
use crate::prelude::*;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use crate::{
events::IoEvents,
fs::{

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use super::*;
use crate::{events::IoEvents, fs::inode_handle::FileIo, prelude::*, process::signal::Poller};

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
/// Error number.
#[repr(i32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use super::Events;
/// An observer for events.

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::time::Duration;
use aster_util::slot_vec::SlotVec;

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use super::*;
use crate::{events::IoEvents, fs::inode_handle::FileIo, process::signal::Poller};

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use super::*;
use crate::{
device::PtySlave, events::IoEvents, fs::inode_handle::FileIo, process::signal::Poller,

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use core::{
sync::atomic::{AtomicBool, Ordering},
time::Duration,

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use core::ops::Range;
use align_ext::AlignExt;

View File

@ -1,4 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
pub(super) const ROOT_INODE_HASH: usize = 0;
// Other pub(super) constants

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use core::ops::Range;
use aster_frame::mm::VmIo;

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use core::{num::NonZeroUsize, ops::Range, sync::atomic::AtomicU64};
use aster_block::{bio::BioWaiter, id::BlockId, BlockDevice};

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use alloc::string::String;
use core::{cmp::Ordering, time::Duration};

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use align_ext::AlignExt;
use aster_rights::Full;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use bitvec::prelude::BitVec;
/// A blocks hole descriptor implemented by the `BitVec`.

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use super::{
inode::{FileType, MAX_FNAME_LEN},
prelude::*,

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use super::{
block_group::{BlockGroup, RawGroupDescriptor},
block_ptr::Ext2Bid,

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::time::Duration;
use aster_rights::Full;

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use inherit_methods_macro::inherit_methods;
use super::{

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
//! Opend File Handle
use crate::{

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::sync::atomic::{AtomicU8, Ordering};
use aster_util::slot_vec::SlotVec;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
//! Opend Inode-backed File Handle
mod dyn_cap;

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use core::{
sync::atomic::{AtomicU32, Ordering},
time::Duration,

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use super::{
file_handle::FileLike,
utils::{AccessMode, Consumer, InodeMode, InodeType, Metadata, Producer, StatusFlags},

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use super::{
dir::{DirOps, ProcDir},
file::{FileOps, ProcFile},

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::time::Duration;
use aster_util::slot_vec::SlotVec;

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use super::InodeType;
use crate::prelude::*;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::time::Duration;
use aster_rights::Full;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use alloc::sync::Arc;
use hashbrown::HashMap;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use super::{Iface, IpAddress, IpEndpoint};
use crate::{events::Observer, prelude::*};

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use smoltcp::{
iface::{Config, Routes},
phy::{Loopback, Medium},

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use aster_network::AnyNetworkDevice;
use aster_virtio::device::network::DEVICE_NAME;
use smoltcp::{

View File

@ -1,4 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use smoltcp::socket::udp::{RecvError, SendError};
use crate::{

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::sync::atomic::{AtomicBool, Ordering};
use takeable::Takeable;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use alloc::sync::Weak;
use smoltcp::socket::tcp::{RecvError, SendError};

View File

@ -1,4 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use smoltcp::socket::tcp::ListenError;
use super::connected::ConnectedStream;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::sync::atomic::{AtomicBool, Ordering};
use connected::ConnectedStream;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use self::options::SocketOption;
pub use self::util::{
options::LingerOption, send_recv_flags::SendRecvFlags, shutdown_cmd::SockShutdownCmd,

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use super::endpoint::Endpoint;
use crate::{
events::IoEvents,

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use crate::{
events::IoEvents,
fs::utils::{Channel, Consumer, Producer, StatusFlags},

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use core::sync::atomic::{AtomicBool, Ordering};
use super::{connected::Connected, endpoint::Endpoint, listener::push_incoming};

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use super::{
connected::Connected,
endpoint::Endpoint,

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::sync::atomic::Ordering;
use aster_frame::{

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use aster_frame::user::UserSpace;
use super::PosixThread;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use core::sync::atomic::{AtomicBool, Ordering};
use aster_frame::cpu::num_cpus;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use aster_rights::{ReadOp, WriteOp};
use futex::futex_wake;
use robust_list::wake_robust_futex;

Some files were not shown because too many files have changed in this diff Show More