From 6a27ea140b878915126bfc66544cb59599dd81eb Mon Sep 17 00:00:00 2001 From: belliash Date: Wed, 28 Dec 2022 23:30:03 +0100 Subject: [PATCH] Print xtldr debug messages only when debugging enabled --- xtldr/efiutil.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xtldr/efiutil.c b/xtldr/efiutil.c index cd83262..13fd8a9 100644 --- a/xtldr/efiutil.c +++ b/xtldr/efiutil.c @@ -151,8 +151,8 @@ BlDbgPrint(IN PUINT16 Format, { VA_LIST Arguments; - /* Check if EFI serial port is fully initialized */ - if(EfiSerialPort.Flags & COMPORT_FLAG_INIT) + /* Check if debugging enabled and if EFI serial port is fully initialized */ + if(DEBUG && (EfiSerialPort.Flags & COMPORT_FLAG_INIT)) { /* Initialise the va_list */ VA_START(Arguments, Format); @@ -196,8 +196,8 @@ BlEfiPrint(IN PUINT16 Format, /* Print to serial console only if not running under OVMF */ if(RtlWideStringCompare(EfiSystemTable->FirmwareVendor, L"EDK II", 6) != 0) { - /* Check if EFI serial port is fully initialized */ - if(EfiSerialPort.Flags & COMPORT_FLAG_INIT) + /* Check if debugging enabled and if EFI serial port is fully initialized */ + if(DEBUG && (EfiSerialPort.Flags & COMPORT_FLAG_INIT)) { /* Format and print the string to the serial console */ BlStringPrint(BlComPortPutChar, Format, Arguments);