X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=EdkModulePkg%2FUniversal%2FStatusCode%2FPei%2FSerialStatusCodeWorker.c;h=b63692a68d1e19add65c30db9e334ebc4a1171ff;hb=afaa1b87a4f1322491edd545500510b595254eab;hp=fc22b624eceeaeee5cc859004714b306fccad85e;hpb=56836fe92b0a7284bc2e964065e00ad867145826;p=mirror_edk2.git diff --git a/EdkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c b/EdkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c index fc22b624ec..b63692a68d 100644 --- a/EdkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c +++ b/EdkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c @@ -2,14 +2,14 @@ /** @file Serial I/O status code reporting worker. -Copyright (c) 2006, Intel Corporation. All rights reserved. -This software and associated documentation (if any) is furnished -under a license and may only be used or copied in accordance -with the terms of the license. Except as permitted by such -license, no part of this software or documentation may be -reproduced, stored in a retrieval system, or transmitted in any -form or by any means without the express written consent of -Intel Corporation. + Copyright (c) 2006, Intel Corporation + All rights reserved. This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: SerialStatusCodeWorker.c @@ -103,7 +103,14 @@ SerialStatusCodeReportWorker ( // // Print ERROR information into output buffer. // - CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "ERROR: C%x:V%x I%x", CodeType, Value, Instance); + CharCount = AsciiSPrint ( + Buffer, + EFI_STATUS_CODE_DATA_MAX_SIZE, + "ERROR: C%x:V%x I%x", + CodeType, + Value, + Instance + ); // // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers. @@ -118,7 +125,7 @@ SerialStatusCodeReportWorker ( ); } - if (Data) { + if (Data != NULL) { CharCount += AsciiSPrint ( &Buffer[CharCount - 1], (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)), @@ -133,15 +140,28 @@ SerialStatusCodeReportWorker ( "\n\r" ); } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) { - CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "PROGRESS CODE: V%x I%x\n\r", Value, Instance); + CharCount = AsciiSPrint ( + Buffer, + EFI_STATUS_CODE_DATA_MAX_SIZE, + "PROGRESS CODE: V%x I%x\n\r", + Value, + Instance + ); } else { - CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "Undefined: C%x:V%x I%x\n\r", CodeType, Value, Instance); + CharCount = AsciiSPrint ( + Buffer, + EFI_STATUS_CODE_DATA_MAX_SIZE, + "Undefined: C%x:V%x I%x\n\r", + CodeType, + Value, + Instance + ); } // // Callout to SerialPort Lib function to do print. // - SerialPortWrite (Buffer, CharCount); + SerialPortWrite ((UINT8 *) Buffer, CharCount); return EFI_SUCCESS; }