changeset 18851:caa88f9faf07

loader.efi: Migrate has_keyboard to bool. illumos issue #9612
author Toomas Soome <tsoome@me.com>
date Sat, 16 Jun 2018 10:22:42 +0300
parents 4ba45ee33896
children 7bd5e8564fc9
files usr/src/boot/sys/boot/efi/loader/main.c
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/boot/sys/boot/efi/loader/main.c	Thu Jun 14 14:58:47 2018 +0300
+++ b/usr/src/boot/sys/boot/efi/loader/main.c	Sat Jun 16 10:22:42 2018 +0300
@@ -70,14 +70,14 @@
 	return (h == img->DeviceHandle);
 }
 
-static int
+static bool
 has_keyboard(void)
 {
 	EFI_STATUS status;
 	EFI_DEVICE_PATH *path;
 	EFI_HANDLE *hin, *hin_end, *walker;
 	UINTN sz;
-	int retval = 0;
+	bool retval = false;
 
 	/*
 	 * Find all the handles that support the SIMPLE_TEXT_INPUT_PROTOCOL and
@@ -94,7 +94,7 @@
 			free(hin);
 	}
 	if (EFI_ERROR(status))
-		return retval;
+		return (retval);
 
 	/*
 	 * Look at each of the handles. If it supports the device path protocol,
@@ -124,7 +124,7 @@
 				acpi = (ACPI_HID_DEVICE_PATH *)(void *)path;
 				if ((EISA_ID_TO_NUM(acpi->HID) & 0xff00) == 0x300 &&
 				    (acpi->HID & 0xffff) == PNP_EISA_ID_CONST) {
-					retval = 1;
+					retval = true;
 					goto out;
 				}
 			/*
@@ -140,7 +140,7 @@
 				if (usb->DeviceClass == 3 && /* HID */
 				    usb->DeviceSubClass == 1 && /* Boot devices */
 				    usb->DeviceProtocol == 1) { /* Boot keyboards */
-					retval = 1;
+					retval = true;
 					goto out;
 				}
 			}
@@ -149,7 +149,7 @@
 	}
 out:
 	free(hin);
-	return retval;
+	return (retval);
 }
 
 static void
@@ -294,7 +294,7 @@
 	bool vargood;
 	void *ptr;
 	UINTN k;
-	int has_kbd;
+	bool has_kbd;
 
 	archsw.arch_autoload = efi_autoload;
 	archsw.arch_getdev = efi_getdev;