[PATCH 4/5] ds414: Auto-populate env if appropriate

Stefan Roese sr at denx.de
Thu Mar 4 14:22:15 CET 2021


On 04.03.21 14:20, Phil Sutter wrote:
> On Thu, Mar 04, 2021 at 02:06:01PM +0100, Stefan Roese wrote:
>> On 03.03.21 01:55, Phil Sutter wrote:
>>> Define a misc_init_r() which calls "syno populate_env" if the
>>> environment seems incomplete (or default), indicated by missing
>>> "ethaddr" variable. With this in place, no random MAC address fallback
>>> is needed anymore.
>>>
>>> Signed-off-by: Phil Sutter <phil at nwl.cc>
>>> ---
>>>    board/Synology/ds414/cmd_syno.c |  2 +-
>>>    board/Synology/ds414/ds414.c    | 13 +++++++++++++
>>>    configs/ds414_defconfig         |  4 +---
>>>    3 files changed, 15 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/board/Synology/ds414/cmd_syno.c b/board/Synology/ds414/cmd_syno.c
>>> index a120c3123ffb3..07bb395da3acc 100644
>>> --- a/board/Synology/ds414/cmd_syno.c
>>> +++ b/board/Synology/ds414/cmd_syno.c
>>> @@ -22,7 +22,7 @@
>>>    #define SYNO_CHKSUM_TAG		"CHK="
>>>    
>>>    
>>> -static int do_syno_populate(int argc, char *const argv[])
>>> +int do_syno_populate(int argc, char *const argv[])
>>>    {
>>>    	unsigned int bus = CONFIG_SF_DEFAULT_BUS;
>>>    	unsigned int cs = CONFIG_SF_DEFAULT_CS;
>>> diff --git a/board/Synology/ds414/ds414.c b/board/Synology/ds414/ds414.c
>>> index 9c4ce670ddfbd..c2469d6665255 100644
>>> --- a/board/Synology/ds414/ds414.c
>>> +++ b/board/Synology/ds414/ds414.c
>>> @@ -179,6 +179,19 @@ int board_init(void)
>>>    	return 0;
>>>    }
>>>    
>>> +#ifndef CONFIG_SPL_BUILD
>>> +int do_syno_populate(int argc, char *const argv[]);
>>
>> I suspect that this prototype in a C file will trigger at least a
>> checkpatch warning?
> 
> What is checkpatch? ;)

Provided with Linux and your favorite bootloader: ;)

./scripts/checkpatch.pl

> Mea culpa, sometimes past me's dirty hacks slip my review. I'll go find
> a checkpatch-compliant way.

NP. Thanks for working on this.

Thanks,
Stefan


More information about the U-Boot mailing list