[PATCH v6 05/25] spl: Remove NULL assignments in spl_load_info

Sean Anderson seanga2 at gmail.com
Wed Nov 8 16:30:27 CET 2023


On 11/7/23 23:23, Simon Glass wrote:
> Hi Sean,
> 
> On Sun, 5 Nov 2023 at 19:26, Sean Anderson <seanga2 at gmail.com> wrote:
>>
>> Remove NULL assignments to fields in spl_load_info when .load doesn't
>> reference these fields. This can result in more efficient code. filename
>> must stay even if it is unused, since load_simple_fit uses it.
>>
>> Signed-off-by: Sean Anderson <seanga2 at gmail.com>
>> ---
>>
>> Changes in v6:
>> - New
>>
>>   arch/arm/mach-sunxi/spl_spi_sunxi.c | 2 --
>>   common/spl/spl_fat.c                | 1 -
>>   common/spl/spl_mmc.c                | 2 --
>>   common/spl/spl_nand.c               | 4 ----
>>   common/spl/spl_spi.c                | 2 --
>>   common/spl/spl_ymodem.c             | 1 -
>>   6 files changed, 12 deletions(-)
> 
> This makes me wonder if we should have a function to clear it out
> (using memset() and perhaps a bl_len parameter)? Having said that, the
> info-field use is pretty self-contained with these files.
> 
> Reviewed-by: Simon Glass <sjg at chromium.org>

It would be simpler, but this series causes bloat in other areas and this
is a very simple way to reduce text size.

--Sean


More information about the U-Boot mailing list