summaryrefslogtreecommitdiff
path: root/src/boot/efi/boot.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot/efi/boot.c')
-rw-r--r--src/boot/efi/boot.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c
index ef7ad66eb9..2a84abe131 100644
--- a/src/boot/efi/boot.c
+++ b/src/boot/efi/boot.c
@@ -1512,11 +1512,11 @@ static VOID config_load_entries(
static INTN config_entry_compare(ConfigEntry *a, ConfigEntry *b) {
INTN r;
- /* Order entries that have no tries left to the end of the list */
+ /* Order entries that have no tries left to the beginning of the list */
if (a->tries_left != 0 && b->tries_left == 0)
- return -1;
- if (a->tries_left == 0 && b->tries_left != 0)
return 1;
+ if (a->tries_left == 0 && b->tries_left != 0)
+ return -1;
r = str_verscmp(a->id, b->id);
if (r != 0)
@@ -1526,17 +1526,17 @@ static INTN config_entry_compare(ConfigEntry *a, ConfigEntry *b) {
b->tries_left == (UINTN) -1)
return 0;
- /* If both items have boot counting, and otherwise are identical, put the entry with more tries left first */
+ /* If both items have boot counting, and otherwise are identical, put the entry with more tries left last */
if (a->tries_left > b->tries_left)
- return -1;
- if (a->tries_left < b->tries_left)
return 1;
+ if (a->tries_left < b->tries_left)
+ return -1;
/* If they have the same number of tries left, then let the one win which was tried fewer times so far */
if (a->tries_done < b->tries_done)
- return -1;
- if (a->tries_done > b->tries_done)
return 1;
+ if (a->tries_done > b->tries_done)
+ return -1;
return 0;
}