summaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-10-08 08:14:32 +0000
committerTom Rini <trini@ti.com>2012-10-17 07:59:10 -0700
commit38a3021edc5421a2fae90d57112d001d74bba1fa (patch)
treed8954eccc59d5f347119760dbc1e79b2fd454556 /disk
parent71bba424adcfa8c44100dee0fd139cc057eace65 (diff)
downloadu-boot-38a3021edc5421a2fae90d57112d001d74bba1fa.tar.gz
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>
Diffstat (limited to 'disk')
-rw-r--r--disk/part_efi.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/disk/part_efi.c b/disk/part_efi.c
index 264ea9c77f..008177ecb0 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -138,15 +138,14 @@ void print_part_efi(block_dev_desc_t * dev_desc)
printf("Part\tName\t\t\tStart LBA\tEnd LBA\n");
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),
- print_efiname(&gpt_pte[i]),
- le64_to_int(gpt_pte[i].starting_lba),
- le64_to_int(gpt_pte[i].ending_lba));
- } else {
- break; /* Stop at the first non valid PTE */
- }
+ printf("%3d\t%-18s\t0x%08llX\t0x%08llX\n", (i + 1),
+ print_efiname(&gpt_pte[i]),
+ le64_to_int(gpt_pte[i].starting_lba),
+ le64_to_int(gpt_pte[i].ending_lba));
}
/* Remember to free pte */