Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 4f0c46c

Browse files
libefiwrapper: use putchar() to send a simple character
Call printf() to write a simple char is overkill. Change-Id: Ideb99a962d6ec65f06ff87cbf566f7c8e946921a Signed-off-by: Jeremy Compostella <[email protected]>
1 parent 9fb270c commit 4f0c46c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

include/libefiwrapper/external.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ int strncmp(const char *s1, const char *s2, size_t n);
7878
int printf(const char *format, ...);
7979
int snprintf(char *str, size_t size, const char *fmt, ...);
8080
int getchar(void);
81+
int putchar(unsigned int i);
8182

8283
/* libpayload.h */
8384
void ndelay(unsigned int n);

libefiwrapper/conout.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, Intel Corporation
2+
* Copyright (c) 2016-2020, Intel Corporation
33
* All rights reserved.
44
*
55
* Author: Jérémy Compostella <[email protected]>
@@ -45,7 +45,7 @@ conout_output_string(__attribute__((__unused__)) struct _SIMPLE_TEXT_OUTPUT_INTE
4545
CHAR16 *String)
4646
{
4747
while (*String)
48-
printf("%c", *String++);
48+
putchar(*String++);
4949

5050
return EFI_SUCCESS;
5151
}

libefiwrapper/serialio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, Intel Corporation
2+
* Copyright (c) 2016-2020, Intel Corporation
33
* All rights reserved.
44
*
55
* Authors: Jérémy Compostella <[email protected]>
@@ -49,7 +49,7 @@ serialio_write(__attribute__((__unused__)) SERIAL_IO_INTERFACE *This,
4949
return EFI_INVALID_PARAMETER;
5050

5151
for (i = 0; i < *BufferSize; i++)
52-
printf("%c", ((char *)Buffer)[i]);
52+
putchar(((unsigned char *)Buffer)[i]);
5353

5454
return EFI_SUCCESS;
5555
}

0 commit comments

Comments
 (0)