[PATCH 2/2] EFI: handle more boot devices

Michael Olbrich m.olbrich at pengutronix.de
Tue Aug 12 02:37:21 PDT 2014


efi_get_boot() fails for partitions that are not supported, so errors must
be ignored to find all supported devices.

Signed-off-by: Michael Olbrich <m.olbrich at pengutronix.de>
---

I'm not sure about this one. We're not doing anythings with the return
value of efi_get_boot(), so this is just some debug output + memory leak.

Also, 100 is rather arbitrary. Maybe EFI has some limit there as well?

Michael

 arch/efi/efi/efi.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/efi/efi/efi.c b/arch/efi/efi/efi.c
index 7de8ec8..ceb4479 100644
--- a/arch/efi/efi/efi.c
+++ b/arch/efi/efi/efi.c
@@ -134,9 +134,10 @@ struct efi_boot *efi_get_boot(int num)
 
 static int misc_init(void)
 {
-	efi_get_boot(1);
-	efi_get_boot(2);
-	efi_get_boot(3);
+	int i;
+
+	for (i = 1; i < 100; ++i)
+		efi_get_boot(i);
 
 	return 0;
 }
-- 
2.0.1




More information about the barebox mailing list