diff options
author | Rasmus Villemoes | 2020-11-20 11:45:35 +0100 |
---|---|---|
committer | Tom Rini | 2021-01-16 14:49:09 -0500 |
commit | 31ce367cd10087b532431c023e4a95513ecdee5d (patch) | |
tree | abe69d421178391a6cffe43b6c231d92f9100ef8 /disk/part_efi.c | |
parent | 2d572ede1185db2129685e8cedfb690a5e3c4d3d (diff) |
lib/uuid.c: change prototype of uuid_guid_get_str()
There's no reason to require an appropriately sized output parameter
for the string, that's error-prone should the table ever grow an
element with a longer string. We can just return the const char*
pointer directly.
Update the only caller accordingly, and get rid of pointless ifdeffery
in the header so that the compiler always sees a declaration and can
thus do type-checking, whether or not PARTITION_TYPE_GUID is enabled
or not.
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Diffstat (limited to 'disk/part_efi.c')
-rw-r--r-- | disk/part_efi.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/disk/part_efi.c b/disk/part_efi.c index 60b1c1d7618..2f922662e6e 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -247,10 +247,11 @@ void part_print_efi(struct blk_desc *dev_desc) uuid_bin = (unsigned char *)gpt_pte[i].partition_type_guid.b; uuid_bin_to_str(uuid_bin, uuid, UUID_STR_FORMAT_GUID); printf("\ttype:\t%s\n", uuid); -#ifdef CONFIG_PARTITION_TYPE_GUID - if (!uuid_guid_get_str(uuid_bin, uuid)) - printf("\ttype:\t%s\n", uuid); -#endif + if (CONFIG_IS_ENABLED(PARTITION_TYPE_GUID)) { + const char *type = uuid_guid_get_str(uuid_bin); + if (type) + printf("\ttype:\t%s\n", type); + } uuid_bin = (unsigned char *)gpt_pte[i].unique_partition_guid.b; uuid_bin_to_str(uuid_bin, uuid, UUID_STR_FORMAT_GUID); printf("\tguid:\t%s\n", uuid); |