mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-31 19:41:46 +00:00
disk: part_efi: remove indent level from loop
Simplify the partition printing loop in print_part_efi() to bail out early when the first invalid partition is found, rather than indenting the whole body of the loop. This simplifies later patches. Signed-off-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
parent
71bba424ad
commit
38a3021edc
1 changed files with 7 additions and 8 deletions
|
@ -138,15 +138,14 @@ void print_part_efi(block_dev_desc_t * dev_desc)
|
||||||
|
|
||||||
printf("Part\tName\t\t\tStart LBA\tEnd LBA\n");
|
printf("Part\tName\t\t\tStart LBA\tEnd LBA\n");
|
||||||
for (i = 0; i < le32_to_int(gpt_head->num_partition_entries); i++) {
|
for (i = 0; i < le32_to_int(gpt_head->num_partition_entries); i++) {
|
||||||
|
/* Stop at the first non valid PTE */
|
||||||
|
if (!is_pte_valid(&gpt_pte[i]))
|
||||||
|
break;
|
||||||
|
|
||||||
if (is_pte_valid(&gpt_pte[i])) {
|
printf("%3d\t%-18s\t0x%08llX\t0x%08llX\n", (i + 1),
|
||||||
printf("%3d\t%-18s\t0x%08llX\t0x%08llX\n", (i + 1),
|
print_efiname(&gpt_pte[i]),
|
||||||
print_efiname(&gpt_pte[i]),
|
le64_to_int(gpt_pte[i].starting_lba),
|
||||||
le64_to_int(gpt_pte[i].starting_lba),
|
le64_to_int(gpt_pte[i].ending_lba));
|
||||||
le64_to_int(gpt_pte[i].ending_lba));
|
|
||||||
} else {
|
|
||||||
break; /* Stop at the first non valid PTE */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remember to free pte */
|
/* Remember to free pte */
|
||||||
|
|
Loading…
Add table
Reference in a new issue