diff mbox

[U-Boot,1/2] bdinfo: Don't print out empty DRAM banks

Message ID 1470455849-30860-1-git-send-email-sjg@chromium.org
State Accepted
Commit ddd917b8fa32c3ef5e2609282d7e5d8f299f1872
Delegated to: Bin Meng
Headers show

Commit Message

Simon Glass Aug. 6, 2016, 3:57 a.m. UTC
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>
---

 cmd/bdinfo.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Tom Rini Aug. 6, 2016, 4:59 p.m. UTC | #1
On Fri, Aug 05, 2016 at 09:57:27PM -0600, Simon Glass wrote:

> 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>
Bin Meng Aug. 7, 2016, 6:41 a.m. UTC | #2
On Sat, Aug 6, 2016 at 11:57 AM, Simon Glass <sjg@chromium.org> wrote:
> 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>
> ---
>
>  cmd/bdinfo.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Bin Meng Aug. 9, 2016, 2:39 a.m. UTC | #3
On Sun, Aug 7, 2016 at 2:41 PM, Bin Meng <bmeng.cn@gmail.com> wrote:
> On Sat, Aug 6, 2016 at 11:57 AM, Simon Glass <sjg@chromium.org> wrote:
>> 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>
>> ---
>>
>>  cmd/bdinfo.c | 8 +++++---
>>  1 file changed, 5 insertions(+), 3 deletions(-)
>>
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

applied to u-boot-x86, thanks!
diff mbox

Patch

diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index 637463e..696c67a 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
 }