[U-Boot] [PATCH 8/9] disk: part_dos: align partition table prints

Stephen Warren swarren at wwwdotorg.org
Fri Oct 5 21:29:53 CEST 2012


From: Stephen Warren <swarren at nvidia.com>

When printing the partition table, make sure data aligns with the column
headers. Change format of partition number field to %3d to match
part_efi.c.

Signed-off-by: Stephen Warren <swarren at nvidia.com>
---
 disk/part_dos.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/disk/part_dos.c b/disk/part_dos.c
index 0fadc17..aed0c77 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -71,7 +71,7 @@ static void print_one_part(dos_partition_t *p, int ext_part_sector,
 	int lba_start = ext_part_sector + le32_to_int (p->start4);
 	int lba_size  = le32_to_int (p->size4);
 
-	printf("%5d\t\t%10d\t%10d\t%2x%s%s\n",
+	printf("%3d\t%-10d\t%-10d\t%02x%s%s\n",
 		part_num, lba_start, lba_size, p->sys_ind,
 		(is_extended(p->sys_ind) ? " Extd" : ""),
 		(is_bootable(p) ? " Boot" : ""));
@@ -265,7 +265,7 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc, int ext_part
 
 void print_part_dos (block_dev_desc_t *dev_desc)
 {
-	printf("Partition     Start Sector     Num Sectors     Type\n");
+	printf("Part\tStart Sector\tNum Sectors\tType\n");
 	print_partition_extended(dev_desc, 0, 0, 1);
 }
 
-- 
1.7.0.4



More information about the U-Boot mailing list