The UEFI function LocateHandleBuffer() always writes to the value pointed to by its NoHandles argument (in the test, `count'); remove the unnecessary initializations.
Remove also one copy to buffer_size, which has become unnecessary. Signed-off-by: Vincent Stehlé <[email protected]> Cc: Heinrich Schuchardt <[email protected]> Cc: Ilias Apalodimas <[email protected]> Cc: Tom Rini <[email protected]> --- lib/efi_selftest/efi_selftest_manageprotocols.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/efi_selftest/efi_selftest_manageprotocols.c b/lib/efi_selftest/efi_selftest_manageprotocols.c index 0334a074866..7fe7b285011 100644 --- a/lib/efi_selftest/efi_selftest_manageprotocols.c +++ b/lib/efi_selftest/efi_selftest_manageprotocols.c @@ -219,7 +219,6 @@ static int execute(void) * * handle1, handle2 */ - count = buffer_size; ret = boottime->locate_handle_buffer(BY_PROTOCOL, &guid1, NULL, &count, &buffer); if (ret != EFI_SUCCESS) { @@ -257,7 +256,6 @@ static int execute(void) efi_st_error("LocateHandle failed to locate new handles\n"); return EFI_ST_FAILURE; } - buffer_size = count; ret = find_in_buffer(handle1, count, buffer); if (ret != EFI_SUCCESS) { efi_st_error("LocateHandle failed to locate new handles\n"); @@ -303,7 +301,6 @@ static int execute(void) /* * Check that the protocols are really uninstalled. */ - count = buffer_size; ret = boottime->locate_handle_buffer(BY_PROTOCOL, &guid1, NULL, &count, &buffer); if (ret != EFI_SUCCESS) { -- 2.51.0

