From 3069e17d78867becc7e9a8ff9cdeac8554c5fb33 Mon Sep 17 00:00:00 2001 From: equation314 Date: Sat, 5 Oct 2019 13:02:43 +0800 Subject: [PATCH] Remove unnecessary `lazy_static` --- kernel/src/arch/aarch64/memory.rs | 6 ++---- kernel/src/drivers/console/mod.rs | 4 +--- kernel/src/drivers/gpu/fb.rs | 4 +--- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/kernel/src/arch/aarch64/memory.rs b/kernel/src/arch/aarch64/memory.rs index 18d226ba..68dda164 100644 --- a/kernel/src/arch/aarch64/memory.rs +++ b/kernel/src/arch/aarch64/memory.rs @@ -4,12 +4,10 @@ use super::paging::MMIOType; use crate::consts::{KERNEL_OFFSET, MEMORY_OFFSET}; use crate::memory::{init_heap, kernel_offset, Linear, MemoryAttr, MemorySet, FRAME_ALLOCATOR}; use log::*; -use spin::Mutex; use rcore_memory::PAGE_SIZE; +use spin::Mutex; -lazy_static! { - static ref KERNEL_MEMORY_SET: Mutex> = Mutex::new(None); -} +static KERNEL_MEMORY_SET: Mutex> = Mutex::new(None); /// Memory initialization. pub fn init() { diff --git a/kernel/src/drivers/console/mod.rs b/kernel/src/drivers/console/mod.rs index bc87b51e..f2ccb5df 100644 --- a/kernel/src/drivers/console/mod.rs +++ b/kernel/src/drivers/console/mod.rs @@ -7,9 +7,7 @@ use spin::Mutex; // Console -> TextBuffer -> FrameBuffer type RCoreConsole = ConsoleOnGraphic; -lazy_static! { - pub static ref CONSOLE: Mutex> = Mutex::new(None); -} +pub static CONSOLE: Mutex> = Mutex::new(None); /// Initialize console driver pub fn init() { diff --git a/kernel/src/drivers/gpu/fb.rs b/kernel/src/drivers/gpu/fb.rs index 3c857a4a..2dce75fc 100644 --- a/kernel/src/drivers/gpu/fb.rs +++ b/kernel/src/drivers/gpu/fb.rs @@ -295,9 +295,7 @@ impl ColorEncode for Rgb888 { } } -lazy_static! { - pub static ref FRAME_BUFFER: Mutex> = Mutex::new(None); -} +pub static FRAME_BUFFER: Mutex> = Mutex::new(None); /// Initialize framebuffer ///