efi_loader: reimplement LocateDevicePath
[oweals/u-boot.git] / lib / efi_selftest / efi_selftest_util.c
index c9c295e2fbebed158d7a9ad4e857b8d7baf9db3c..1b17bf4d4bc4c290a539f41f275cd6832c6627a9 100644 (file)
@@ -17,9 +17,18 @@ 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;
        }
-       return EFI_ST_SUCCESS;
+       return 0;
+}
+
+int efi_st_strcmp_16_8(const u16 *buf1, const char *buf2)
+{
+       for (; *buf1 || *buf2; ++buf1, ++buf2) {
+               if (*buf1 != *buf2)
+                       return *buf1 - *buf2;
+       }
+       return 0;
 }