From 95744692a5305d4e922d2abd9b95ca2e8701fa3e Mon Sep 17 00:00:00 2001 From: stuuupidcat Date: Tue, 20 May 2025 16:13:24 +0000 Subject: [PATCH] Remove unnecessary #[inline] attributes --- kernel/comps/virtio/src/queue.rs | 1 - kernel/src/fs/ext2/fs.rs | 4 ---- kernel/src/fs/ext2/indirect_block_cache.rs | 1 - kernel/src/fs/ext2/inode.rs | 1 - ostd/src/arch/x86/kernel/pic.rs | 1 - ostd/src/bus/pci/capability/vendor.rs | 1 - 6 files changed, 9 deletions(-) diff --git a/kernel/comps/virtio/src/queue.rs b/kernel/comps/virtio/src/queue.rs index 213ba04b..f571059f 100644 --- a/kernel/comps/virtio/src/queue.rs +++ b/kernel/comps/virtio/src/queue.rs @@ -421,7 +421,6 @@ pub struct Descriptor { type DescriptorPtr<'a> = SafePtr>; -#[inline] fn set_dma_buf(desc_ptr: &DescriptorPtr, buf: &T) { // TODO: skip the empty dma buffer or just return error? debug_assert_ne!(buf.len(), 0); diff --git a/kernel/src/fs/ext2/fs.rs b/kernel/src/fs/ext2/fs.rs index f09e722e..f81a8866 100644 --- a/kernel/src/fs/ext2/fs.rs +++ b/kernel/src/fs/ext2/fs.rs @@ -410,7 +410,6 @@ impl Ext2 { Ok(()) } - #[inline] fn block_group_of_bid(&self, bid: Ext2Bid) -> Result<(usize, &BlockGroup)> { let block_group_idx = (bid / self.blocks_per_group) as usize; if block_group_idx >= self.block_groups.len() { @@ -419,7 +418,6 @@ impl Ext2 { Ok((block_group_idx, &self.block_groups[block_group_idx])) } - #[inline] fn block_group_of_ino(&self, ino: u32) -> Result<(usize, &BlockGroup)> { let block_group_idx = ((ino - 1) / self.inodes_per_group) as usize; if block_group_idx >= self.block_groups.len() { @@ -428,12 +426,10 @@ impl Ext2 { Ok((block_group_idx, &self.block_groups[block_group_idx])) } - #[inline] fn inode_idx(&self, ino: u32) -> u32 { (ino - 1) % self.inodes_per_group } - #[inline] fn block_idx(&self, bid: Ext2Bid) -> Ext2Bid { bid % self.blocks_per_group } diff --git a/kernel/src/fs/ext2/indirect_block_cache.rs b/kernel/src/fs/ext2/indirect_block_cache.rs index c65bed69..2297f42b 100644 --- a/kernel/src/fs/ext2/indirect_block_cache.rs +++ b/kernel/src/fs/ext2/indirect_block_cache.rs @@ -128,7 +128,6 @@ impl IndirectBlockCache { Ok(()) } - #[inline] fn fs(&self) -> Arc { self.fs.upgrade().unwrap() } diff --git a/kernel/src/fs/ext2/inode.rs b/kernel/src/fs/ext2/inode.rs index 1e19c0a2..ffc8c2c8 100644 --- a/kernel/src/fs/ext2/inode.rs +++ b/kernel/src/fs/ext2/inode.rs @@ -2196,7 +2196,6 @@ impl InodeDesc { blocks } - #[inline] fn size_to_blocks(&self, size: usize) -> Ext2Bid { if self.type_ == InodeType::SymLink && size <= MAX_FAST_SYMLINK_LEN { return 0; diff --git a/ostd/src/arch/x86/kernel/pic.rs b/ostd/src/arch/x86/kernel/pic.rs index 67267188..ce6ac8cc 100644 --- a/ostd/src/arch/x86/kernel/pic.rs +++ b/ostd/src/arch/x86/kernel/pic.rs @@ -112,7 +112,6 @@ pub fn set_mask(master_mask: u8, slave_mask: u8) { SLAVE_DATA.write(slave_mask); } -#[inline(always)] pub(crate) fn ack() { MASTER_CMD.write(0x20); } diff --git a/ostd/src/bus/pci/capability/vendor.rs b/ostd/src/bus/pci/capability/vendor.rs index 14bd3c11..16c6e66c 100644 --- a/ostd/src/bus/pci/capability/vendor.rs +++ b/ostd/src/bus/pci/capability/vendor.rs @@ -70,7 +70,6 @@ impl CapabilityVndrData { Ok(()) } - #[inline] fn check_range(&self, offset: u16) -> Result<()> { if self.length < offset { return Err(Error::InvalidArgs);