From e616100eab84464f09baa93b3fe5c15087a385c1 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 11 Mar 2019 22:04:51 +0100 Subject: efi_loader: fix build error for freestanding.o Since commit f51a226436a87 ("efi_loader: provide freestanding library") in parallel builds errors lib/efi_selftest/../efi_loader/efi_freestanding.o: file not recognized: File truncated occur. Obviously make cannot correctly sequence parallel builds with a dependency like ../efi_loader/efi_freestanding.o. Fixes: f51a226436a87 ("efi_loader: provide freestanding library") Signed-off-by: Heinrich Schuchardt --- lib/efi_selftest/efi_freestanding.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lib/efi_selftest/efi_freestanding.c (limited to 'lib/efi_selftest') diff --git a/lib/efi_selftest/efi_freestanding.c b/lib/efi_selftest/efi_freestanding.c new file mode 100644 index 0000000000..4b6c27e99f --- /dev/null +++ b/lib/efi_selftest/efi_freestanding.c @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Library for freestanding binary + * + * Copyright 2019, Heinrich Schuchardt + * + * GCC requires that freestanding programs provide memcpy(), memmove(), + * memset(), and memcmp(). + */ + +#include "../efi_loader/efi_freestanding.c" -- cgit From d0bd87612f410a723d5ddb3001e805485e3efb4f Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 19 Mar 2019 20:08:46 +0100 Subject: efi_selftest: fix test_hii_string_get_string() The check testing the string result of get_string() returned the wrong result. The result was ignored. Use efi_st_strcmp_16_8() for the string comparison. Signed-off-by: Heinrich Schuchardt --- lib/efi_selftest/efi_selftest_hii.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'lib/efi_selftest') diff --git a/lib/efi_selftest/efi_selftest_hii.c b/lib/efi_selftest/efi_selftest_hii.c index 8a0b3bc353..f4b70f7950 100644 --- a/lib/efi_selftest/efi_selftest_hii.c +++ b/lib/efi_selftest/efi_selftest_hii.c @@ -783,19 +783,10 @@ static int test_hii_string_get_string(void) goto out; } -#if 1 - u16 *c1, *c2; - - for (c1 = string, c2 = L"Japanese"; *c1 == *c2; c1++, c2++) - ; - if (!*c1 && !*c2) - result = EFI_ST_SUCCESS; - else - result = EFI_ST_FAILURE; -#else - /* TODO: %ls */ - efi_st_printf("got string is %s (can be wrong)\n", string); -#endif + if (efi_st_strcmp_16_8(string, "Japanese")) { + efi_st_error("get_string returned incorrect string\n"); + goto out; + } result = EFI_ST_SUCCESS; -- cgit From d0826507e2d24974cb99bfa8cac39d7684107994 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 26 Mar 2019 05:56:31 +0100 Subject: efi_selftest: avoid double free in dp utilities test Avoid duplicate FreePool() in unit test for the device patch utilities protocol. Signed-off-by: Heinrich Schuchardt --- lib/efi_selftest/efi_selftest_devicepath_util.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'lib/efi_selftest') diff --git a/lib/efi_selftest/efi_selftest_devicepath_util.c b/lib/efi_selftest/efi_selftest_devicepath_util.c index 5fef5cfccd..c846e057d3 100644 --- a/lib/efi_selftest/efi_selftest_devicepath_util.c +++ b/lib/efi_selftest/efi_selftest_devicepath_util.c @@ -256,11 +256,6 @@ static int execute(void) efi_st_error("GetNextDevicePathInstance did not signal end\n"); return EFI_ST_FAILURE; } - ret = boottime->free_pool(dp2); - if (ret != EFI_ST_SUCCESS) { - efi_st_error("FreePool failed\n"); - return EFI_ST_FAILURE; - } /* Clean up */ ret = boottime->free_pool(dp2); -- cgit