aboutsummaryrefslogtreecommitdiff
path: root/sys/boot/efi
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot/efi')
-rw-r--r--sys/boot/efi/include/efilib.h2
-rw-r--r--sys/boot/efi/libefi/devpath.c16
2 files changed, 9 insertions, 9 deletions
diff --git a/sys/boot/efi/include/efilib.h b/sys/boot/efi/include/efilib.h
index eaaae613dca0..8721bc576626 100644
--- a/sys/boot/efi/include/efilib.h
+++ b/sys/boot/efi/include/efilib.h
@@ -82,7 +82,7 @@ EFI_HANDLE efi_devpath_handle(EFI_DEVICE_PATH *);
EFI_DEVICE_PATH *efi_devpath_last_node(EFI_DEVICE_PATH *);
EFI_DEVICE_PATH *efi_devpath_trim(EFI_DEVICE_PATH *);
bool efi_devpath_match(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *);
-int efi_devpath_is_prefix(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *);
+bool efi_devpath_is_prefix(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *);
CHAR16 *efi_devpath_name(EFI_DEVICE_PATH *);
void efi_free_devpath_name(CHAR16 *);
diff --git a/sys/boot/efi/libefi/devpath.c b/sys/boot/efi/libefi/devpath.c
index fd863019fd3b..f881cfce9896 100644
--- a/sys/boot/efi/libefi/devpath.c
+++ b/sys/boot/efi/libefi/devpath.c
@@ -167,13 +167,13 @@ efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2)
return (true);
}
-int
+bool
efi_devpath_is_prefix(EFI_DEVICE_PATH *prefix, EFI_DEVICE_PATH *path)
{
- int len;
+ size_t len;
if (prefix == NULL || path == NULL)
- return (0);
+ return (false);
while (1) {
if (IsDevicePathEnd(prefix))
@@ -181,17 +181,17 @@ efi_devpath_is_prefix(EFI_DEVICE_PATH *prefix, EFI_DEVICE_PATH *path)
if (DevicePathType(prefix) != DevicePathType(path) ||
DevicePathSubType(prefix) != DevicePathSubType(path))
- return (0);
+ return (false);
len = DevicePathNodeLength(prefix);
if (len != DevicePathNodeLength(path))
- return (0);
+ return (false);
- if (memcmp(prefix, path, (size_t)len) != 0)
- return (0);
+ if (memcmp(prefix, path, len) != 0)
+ return (false);
prefix = NextDevicePathNode(prefix);
path = NextDevicePathNode(path);
}
- return (1);
+ return (true);
}