From: Heinrich Schuchardt Date: Fri, 6 Oct 2017 18:39:13 +0000 (+0200) Subject: efi_selftest: efi_st_memcmp return difference of bytes X-Git-Tag: v2017.11-rc2~55^2~11 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c155dfeb1e17181998e66830b677baa8983daf6b;p=u-boot efi_selftest: efi_st_memcmp return difference of bytes If the memory regions are different efi_st_memcmp currently returns the difference of the addresses. Insted the difference of the first differing byte pair should be returned. Signed-off-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- diff --git a/lib/efi_selftest/efi_selftest_util.c b/lib/efi_selftest/efi_selftest_util.c index c9c295e2fb..5cffe383d8 100644 --- a/lib/efi_selftest/efi_selftest_util.c +++ b/lib/efi_selftest/efi_selftest_util.c @@ -17,7 +17,7 @@ int efi_st_memcmp(const void *buf1, const void *buf2, size_t length) for (; length; --length) { if (*pos1 != *pos2) - return pos1 - pos2; + return *pos1 - *pos2; ++pos1; ++pos2; }