diff options
author | Manish V Badarkhe <manish.badarkhe@arm.com> | 2024-03-19 10:53:10 +0100 |
---|---|---|
committer | TrustedFirmware Code Review <review@review.trustedfirmware.org> | 2024-03-19 10:53:10 +0100 |
commit | 57249e77583c8cb36d81725e4bc1996688082838 (patch) | |
tree | e8f726337e1471ff8cc596f47e669b89cd18f091 | |
parent | 19e273e6700ba173a7ba8ade4c48872757175d87 (diff) | |
parent | ce574314c6942fd7f308a78fcdf92976774044ba (diff) | |
download | trusted-firmware-a-integration.tar.gz |
Merge "refactor(guid-partition): list.entry_count to unsigned int" into integrationintegration
-rw-r--r-- | drivers/partition/partition.c | 18 | ||||
-rw-r--r-- | include/drivers/partition/partition.h | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/partition/partition.c b/drivers/partition/partition.c index 42e157bead..888a824307 100644 --- a/drivers/partition/partition.c +++ b/drivers/partition/partition.c @@ -190,11 +190,11 @@ static int load_mbr_entry(uintptr_t image_handle, mbr_entry_t *mbr_entry, static int load_mbr_entries(uintptr_t image_handle) { mbr_entry_t mbr_entry; - int i; + unsigned int i; list.entry_count = MBR_PRIMARY_ENTRY_NUMBER; - for (i = 0; i < list.entry_count; i++) { + for (i = 0U; i < list.entry_count; i++) { load_mbr_entry(image_handle, &mbr_entry, i); list.list[i].start = mbr_entry.first_lba * 512; list.list[i].length = mbr_entry.sector_nums * 512; @@ -244,7 +244,7 @@ static int load_partition_gpt(uintptr_t image_handle, gpt_header_t header) return result; } - for (i = 0; i < (unsigned int)list.entry_count; i++) { + for (i = 0U; i < list.entry_count; i++) { result = load_gpt_entry(image_handle, &entry); if (result != 0) { VERBOSE("Failed to load gpt entry data(%u) error is (%i)\n", @@ -441,9 +441,9 @@ out: */ const partition_entry_t *get_partition_entry(const char *name) { - int i; + unsigned int i; - for (i = 0; i < list.entry_count; i++) { + for (i = 0U; i < list.entry_count; i++) { if (strcmp(name, list.list[i].name) == 0) { return &list.list[i]; } @@ -457,9 +457,9 @@ const partition_entry_t *get_partition_entry(const char *name) const partition_entry_t *get_partition_entry_by_type( const struct efi_guid *type_guid) { - int i; + unsigned int i; - for (i = 0; i < list.entry_count; i++) { + for (i = 0U; i < list.entry_count; i++) { if (guidcmp(type_guid, &list.list[i].type_guid) == 0) { return &list.list[i]; } @@ -474,9 +474,9 @@ const partition_entry_t *get_partition_entry_by_type( const partition_entry_t *get_partition_entry_by_guid( const struct efi_guid *part_guid) { - int i; + unsigned int i; - for (i = 0; i < list.entry_count; i++) { + for (i = 0U; i < list.entry_count; i++) { if (guidcmp(part_guid, &list.list[i].part_guid) == 0) { return &list.list[i]; } diff --git a/include/drivers/partition/partition.h b/include/drivers/partition/partition.h index 4183570aa8..9e22d34c4a 100644 --- a/include/drivers/partition/partition.h +++ b/include/drivers/partition/partition.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -41,7 +41,7 @@ typedef struct partition_entry { typedef struct partition_entry_list { partition_entry_t list[PLAT_PARTITION_MAX_ENTRIES]; - int entry_count; + unsigned int entry_count; } partition_entry_list_t; int load_partition_table(unsigned int image_id); |