[U-Boot] [PATCH] image: fix getenv_bootm_size() function

Masahiro Yamada yamada.masahiro at socionext.com
Thu Jan 14 06:50:36 CET 2016


Hi Simon,


2016-01-08 12:33 GMT+09:00 Simon Glass <sjg at chromium.org>:
> Hi Masahiro,
>
> On 17 December 2015 at 22:17, Masahiro Yamada
> <yamada.masahiro at socionext.com> wrote:
>> Currently, this function returns wrong size if "bootm_low" is defined,
>> but "bootm_size" is not.
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
>> ---
>>
>>  common/image.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/common/image.c b/common/image.c
>> index d63d9e0..f4a1dc8 100644
>> --- a/common/image.c
>> +++ b/common/image.c
>> @@ -472,9 +472,9 @@ phys_size_t getenv_bootm_size(void)
>>
>>
>>  #if defined(CONFIG_ARM) && defined(CONFIG_NR_DRAM_BANKS)
>> -       return gd->bd->bi_dram[0].size - tmp;
>> +       return gd->bd->bi_dram[0].size - (tmp - gd->bd->bi_dram[0].start);
>>  #else
>> -       return gd->bd->bi_memsize - tmp;
>> +       return gd->bd->bi_memsize - (tmp - gd->bd->bi_memstart);
>>  #endif
>>  }
>>
>> --
>> 1.9.1
>>
>
> Reviewed-by: Simon Glass <sjg at chromium.org>
>
> But can you please add a comment to the image.h header file as to what
> this function is supposed to do?


This patch is a bug-fix and self-contained.


I assume you suggested the additional comment be a separate work.


-- 
Best Regards
Masahiro Yamada


More information about the U-Boot mailing list