Skip to content

Commit eeaba6f

Browse files
uefi: Fix unused warnings if log-debugcon is not enabled
1 parent 121aa93 commit eeaba6f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

uefi/src/helpers/logger.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,25 @@ pub fn disable() {
4646
/// cloud-hypervisor.
4747
///
4848
/// More info: <https://phip1611.de/blog/how-to-use-qemus-debugcon-feature/>
49-
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
49+
#[cfg(all(
50+
any(target_arch = "x86", target_arch = "x86_64"),
51+
feature = "log-debugcon"
52+
))]
5053
#[derive(Copy, Clone, Debug)]
5154
struct DebugconWriter;
5255

53-
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
56+
#[cfg(all(
57+
any(target_arch = "x86", target_arch = "x86_64"),
58+
feature = "log-debugcon"
59+
))]
5460
impl DebugconWriter {
5561
const IO_PORT: u16 = 0xe9;
5662
}
5763

58-
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
64+
#[cfg(all(
65+
any(target_arch = "x86", target_arch = "x86_64"),
66+
feature = "log-debugcon"
67+
))]
5968
impl core::fmt::Write for DebugconWriter {
6069
fn write_str(&mut self, s: &str) -> fmt::Result {
6170
for &byte in s.as_bytes() {

0 commit comments

Comments
 (0)