Patchwork [U-Boot,V2,8/9] disk: part_dos: align partition table prints

login
register
mail settings
Submitter Stephen Warren
Date Oct. 8, 2012, 6:14 p.m.
Message ID <1349720080-13119-8-git-send-email-swarren@wwwdotorg.org>
Download mbox | patch
Permalink /patch/190079/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Stephen Warren - Oct. 8, 2012, 6:14 p.m.
From: Stephen Warren <swarren@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@nvidia.com>
---
 disk/part_dos.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/disk/part_dos.c b/disk/part_dos.c
index 513a54a..732187a 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" : ""));
@@ -262,7 +262,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);
 }