chiark / gitweb /
shared: remove pointless checks in auto-cleanup functions
[elogind.git] / src / shared / efivars.c
index 840e4e0c350cbbbfeb873375c19f783317f523ae..c42956f84dc9f7bd785c4d62965249ddc635de05 100644 (file)
@@ -28,6 +28,8 @@
 #include "utf8.h"
 #include "efivars.h"
 
+#ifdef ENABLE_EFI
+
 bool is_efi_boot(void) {
         return access("/sys/firmware/efi", F_OK) >= 0;
 }
@@ -306,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) {
@@ -469,3 +466,5 @@ int efi_get_loader_device_part_uuid(sd_id128_t *u) {
 
         return 0;
 }
+
+#endif