From 02a6fc3ea69ba8801bc1864dd393d8df31559667 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sun, 17 Feb 2013 19:54:29 +0100 Subject: [PATCH 1/1] efi: compare by substraction --- src/shared/efivars.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/shared/efivars.c b/src/shared/efivars.c index 8494f3772..c42956f84 100644 --- a/src/shared/efivars.c +++ b/src/shared/efivars.c @@ -308,12 +308,7 @@ static int boot_id_hex(const char s[4]) { static int cmp_uint16(const void *_a, const void *_b) { const uint16_t *a = _a, *b = _b; - if (*a < *b) - return -1; - if (*a > *b) - return 1; - - return 0; + return (int)*a - (int)*b; } int efi_get_boot_options(uint16_t **options) { -- 2.30.2