]> git.sur5r.net Git - u-boot/commitdiff
bdinfo: Don't print out empty DRAM banks
authorSimon Glass <sjg@chromium.org>
Sat, 6 Aug 2016 03:57:27 +0000 (21:57 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Tue, 16 Aug 2016 03:44:09 +0000 (11:44 +0800)
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 <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
cmd/bdinfo.c

index e0bd15d54b0fdad49f6077ede75ceca80aa1c0b1..30bc15862d4b4c5716bc9873b1f437e6fd934182 100644 (file)
@@ -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
 }