refactor(guid-partition): list.entry_count to unsigned int

Change list.entry_count to unsigned int to align with header.list_num,
removing the need for casting.

Change-Id: Id4259d9e841c8d34fe23fb74a7c627f2a643cbf2
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
This commit is contained in:
laurenw-arm 2024-02-29 15:34:39 -06:00
parent e3ecd73116
commit ce574314c6
2 changed files with 11 additions and 11 deletions

View file

@ -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];
}

View file

@ -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);