summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-01-16 13:55:39 +0300
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-01-19 18:16:33 +0300
commitc1528f324c6068936a629233b12c66774accc359 (patch)
treef2095e69e62daf98dc4de1a1d47a463c423f7e84 /lib
parent6a685753ce8b6b02b67d64b239143bf19eda63c9 (diff)
downloadu-boot-c1528f324c6068936a629233b12c66774accc359.tar.xz
lib: compile uuid_guid_get_str if CONFIG_LIB_UUID=y
Currently uuid_guid_get_str() is only built if CONFIG_PARTITION_TYPE_GUID=y. To make it usable for other GUIDs compile it if CONFIG_LIB_UUID=y. The linker will take care of removing it if it is unused. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/uuid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/uuid.c b/lib/uuid.c
index e4703dce2b..56c452ee77 100644
--- a/lib/uuid.c
+++ b/lib/uuid.c
@@ -86,11 +86,11 @@ int uuid_str_valid(const char *uuid)
return 1;
}
-#ifdef CONFIG_PARTITION_TYPE_GUID
static const struct {
const char *string;
efi_guid_t guid;
} list_guid[] = {
+#ifdef CONFIG_PARTITION_TYPE_GUID
{"system", PARTITION_SYSTEM_GUID},
{"mbr", LEGACY_MBR_PARTITION_GUID},
{"msft", PARTITION_MSFT_RESERVED_GUID},
@@ -100,6 +100,7 @@ static const struct {
{"swap", PARTITION_LINUX_SWAP_GUID},
{"lvm", PARTITION_LINUX_LVM_GUID},
{"u-boot-env", PARTITION_U_BOOT_ENVIRONMENT},
+#endif
};
/*
@@ -139,7 +140,6 @@ const char *uuid_guid_get_str(const unsigned char *guid_bin)
}
return NULL;
}
-#endif
/*
* uuid_str_to_bin() - convert string UUID or GUID to big endian binary data.