aboutsummaryrefslogtreecommitdiff
path: root/sys/boot/efi
diff options
context:
space:
mode:
authorToomas Soome <tsoome@FreeBSD.org>2017-09-21 23:14:07 +0000
committerToomas Soome <tsoome@FreeBSD.org>2017-09-21 23:14:07 +0000
commit59fcc285f4e2b79793733922869c0e94375ff17d (patch)
treedbce0ab01bc58700a0f7613dec730d450c9e5942 /sys/boot/efi
parent07f2d905e680fab62da966b18fbc55b632b6d477 (diff)
Notes
Diffstat (limited to 'sys/boot/efi')
-rw-r--r--sys/boot/efi/libefi/devpath.c14
-rw-r--r--sys/boot/efi/libefi/efipart.c4
2 files changed, 9 insertions, 9 deletions
diff --git a/sys/boot/efi/libefi/devpath.c b/sys/boot/efi/libefi/devpath.c
index 662f0a744ef7..934d9d0654b8 100644
--- a/sys/boot/efi/libefi/devpath.c
+++ b/sys/boot/efi/libefi/devpath.c
@@ -139,30 +139,30 @@ efi_devpath_handle(EFI_DEVICE_PATH *devpath)
return (h);
}
-int
+bool
efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2)
{
int len;
if (devpath1 == NULL || devpath2 == NULL)
- return (0);
+ return (false);
- while (1) {
+ while (true) {
if (DevicePathType(devpath1) != DevicePathType(devpath2) ||
DevicePathSubType(devpath1) != DevicePathSubType(devpath2))
- return (0);
+ return (false);
len = DevicePathNodeLength(devpath1);
if (len != DevicePathNodeLength(devpath2))
- return (0);
+ return (false);
if (memcmp(devpath1, devpath2, (size_t)len) != 0)
- return (0);
+ return (false);
if (IsDevicePathEnd(devpath1))
break;
devpath1 = NextDevicePathNode(devpath1);
devpath2 = NextDevicePathNode(devpath2);
}
- return (1);
+ return (true);
}
diff --git a/sys/boot/efi/libefi/efipart.c b/sys/boot/efi/libefi/efipart.c
index 13c70c8151cf..c6e582379084 100644
--- a/sys/boot/efi/libefi/efipart.c
+++ b/sys/boot/efi/libefi/efipart.c
@@ -264,7 +264,7 @@ efipart_cdinfo_add(EFI_HANDLE handle, EFI_HANDLE alias,
unit = 0;
STAILQ_FOREACH(pd, &cdinfo, pd_link) {
- if (efi_devpath_match(pd->pd_devpath, devpath) != 0) {
+ if (efi_devpath_match(pd->pd_devpath, devpath) == true) {
pd->pd_handle = handle;
pd->pd_alias = alias;
return (0);
@@ -394,7 +394,7 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE part_handle)
STAILQ_INIT(&pd->pd_part);
STAILQ_FOREACH(hd, &hdinfo, pd_link) {
- if (efi_devpath_match(hd->pd_devpath, disk_devpath) != 0) {
+ if (efi_devpath_match(hd->pd_devpath, disk_devpath) == true) {
/* Add the partition. */
pd->pd_handle = part_handle;
pd->pd_unit = node->PartitionNumber;