Author: tsoome
Date: Thu Sep 21 23:14:07 2017
New Revision: 323885
URL: https://svnweb.freebsd.org/changeset/base/323885

Log:
  libefi: efi_devpath_match() should return bool
  
  The current implementation of efi_devpath_match() is returning values 0 or 1,
  so it should be updated to return bool.

Modified:
  head/sys/boot/efi/libefi/devpath.c
  head/sys/boot/efi/libefi/efipart.c

Modified: head/sys/boot/efi/libefi/devpath.c
==============================================================================
--- head/sys/boot/efi/libefi/devpath.c  Thu Sep 21 23:10:59 2017        
(r323884)
+++ head/sys/boot/efi/libefi/devpath.c  Thu Sep 21 23:14:07 2017        
(r323885)
@@ -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);
 }

Modified: head/sys/boot/efi/libefi/efipart.c
==============================================================================
--- head/sys/boot/efi/libefi/efipart.c  Thu Sep 21 23:10:59 2017        
(r323884)
+++ head/sys/boot/efi/libefi/efipart.c  Thu Sep 21 23:14:07 2017        
(r323885)
@@ -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 
        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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to