Skip to content

Commit a5a68fe

Browse files
josephlrrbradford
authored andcommitted
logger: Don't use lazy_static for LOGGER
By upgrading to spin 0.5, we can just use the "const fn" Mutex::new. Signed-off-by: Joe Richey <joerichey@google.com>
1 parent 0a8035c commit a5a68fe

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

Cargo.lock

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ log-panic = ["log-serial"]
2525

2626
[dependencies]
2727
cpuio = "*"
28-
spin = "0.4.9"
28+
spin = "0.5"
2929
r-efi = "2.1.0"
3030

3131
[dependencies.lazy_static]

src/logger.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,13 @@
1616
// from Philipp Oppermann
1717

1818
use core::fmt;
19-
use lazy_static::lazy_static;
2019
use spin::Mutex;
2120

2221
use cpuio::Port;
2322

24-
lazy_static! {
25-
pub static ref LOGGER: Mutex<Logger> = Mutex::new(Logger {
26-
port: unsafe { Port::new(0x3f8) }
27-
});
28-
}
23+
pub static LOGGER: Mutex<Logger> = Mutex::new(Logger {
24+
port: unsafe { Port::new(0x3f8) },
25+
});
2926

3027
pub struct Logger {
3128
port: Port<u8>,

0 commit comments

Comments
 (0)