From ddd917b8fa32c3ef5e2609282d7e5d8f299f1872 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 5 Aug 2016 21:57:27 -0600 Subject: [PATCH] bdinfo: Don't print out empty DRAM banks There is no sense in printing out DRAM banks of size 0 since this means they are empty. Skip them. Signed-off-by: Simon Glass Reviewed-by: Tom Rini Reviewed-by: Bin Meng --- cmd/bdinfo.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c index e0bd15d54b..30bc15862d 100644 --- a/cmd/bdinfo.c +++ b/cmd/bdinfo.c @@ -98,9 +98,11 @@ static inline void print_bi_dram(const bd_t *bd) int i; for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) { - print_num("DRAM bank", i); - print_num("-> start", bd->bi_dram[i].start); - print_num("-> size", bd->bi_dram[i].size); + if (bd->bi_dram[i].size) { + print_num("DRAM bank", i); + print_num("-> start", bd->bi_dram[i].start); + print_num("-> size", bd->bi_dram[i].size); + } } #endif } -- 2.39.5