style(partition): use GUID values for GPT partition fields

The GPT partition uses GUID values for identification of partition
types and partitions. Change the relevant functions to use GUID values
instead of UUID's.

Change-Id: I30df66a8a02fb502e04b0285f34131b65977988e
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
This commit is contained in:
Sughosh Ganu 2024-02-02 15:32:10 +05:30
parent 6166051426
commit 37e81a603d
2 changed files with 12 additions and 8 deletions

View file

@ -452,14 +452,15 @@ const partition_entry_t *get_partition_entry(const char *name)
}
/*
* Try retrieving a partition table entry based on the GUID.
* Try retrieving a partition table entry based on the partition type GUID.
*/
const partition_entry_t *get_partition_entry_by_type(const uuid_t *type_uuid)
const partition_entry_t *get_partition_entry_by_type(
const struct efi_guid *type_guid)
{
int i;
for (i = 0; i < list.entry_count; i++) {
if (guidcmp(type_uuid, &list.list[i].type_guid) == 0) {
if (guidcmp(type_guid, &list.list[i].type_guid) == 0) {
return &list.list[i];
}
}
@ -468,14 +469,15 @@ const partition_entry_t *get_partition_entry_by_type(const uuid_t *type_uuid)
}
/*
* Try retrieving a partition table entry based on the UUID.
* Try retrieving a partition table entry based on the unique partition GUID.
*/
const partition_entry_t *get_partition_entry_by_uuid(const uuid_t *part_uuid)
const partition_entry_t *get_partition_entry_by_guid(
const struct efi_guid *part_guid)
{
int i;
for (i = 0; i < list.entry_count; i++) {
if (guidcmp(part_uuid, &list.list[i].part_guid) == 0) {
if (guidcmp(part_guid, &list.list[i].part_guid) == 0) {
return &list.list[i];
}
}

View file

@ -46,8 +46,10 @@ typedef struct partition_entry_list {
int load_partition_table(unsigned int image_id);
const partition_entry_t *get_partition_entry(const char *name);
const partition_entry_t *get_partition_entry_by_type(const uuid_t *type_guid);
const partition_entry_t *get_partition_entry_by_uuid(const uuid_t *part_uuid);
const partition_entry_t *get_partition_entry_by_type(
const struct efi_guid *type_guid);
const partition_entry_t *get_partition_entry_by_guid(
const struct efi_guid *part_guid);
const partition_entry_list_t *get_partition_entry_list(void);
void partition_init(unsigned int image_id);
int gpt_partition_init(void);