[U-Boot] [PATCH] fdt: Fixup only valid memory banks

Stephen Warren swarren at wwwdotorg.org
Tue Jan 30 17:59:33 UTC 2018


On 01/30/2018 03:34 AM, Thierry Reding wrote:
> From: Thierry Reding <treding at nvidia.com>
> 
> Memory banks with address 0 and size 0 are empty and should not be
> passed to the OS via device tree.

>   	if (!banks)
>   		return 0;
>   
> +	for (i = 0; i < banks; i++)
> +		if (start[i] == 0 && size[i] == 0)
> +			break;
> +
> +	banks = i;

Do we want to move the for loop above the check for if (!banks)?

Should we put braces around the multi-line body of the for loop?

Aside from that,
Acked-by: Stephen Warren <swarren at nvidia.com>

> +
>   	len = fdt_pack_reg(blob, tmp, start, size, banks);
>   
>   	err = fdt_setprop(blob, nodeoffset, "reg", tmp, len);


More information about the U-Boot mailing list