[PATCH] fastboot: remove #ifdef CONFIG when it is possible

Sean Anderson sean.anderson at seco.com
Thu Dec 15 16:37:50 CET 2022


On 12/15/22 09:30, Marek Vasut wrote:
> On 12/15/22 10:15, Patrick Delaunay wrote:
>> Much of the fastboot code predates the introduction of Kconfig and
>> has quite a few #ifdefs in it which is unnecessary now that we can use
>> IS_ENABLED() et al.
>>
>> Signed-off-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
>> ---
>>
>>   cmd/fastboot.c                  |  35 +++++------
>>   drivers/fastboot/fb_command.c   | 104 ++++++++++++--------------------
>>   drivers/fastboot/fb_common.c    |  11 ++--
>>   drivers/fastboot/fb_getvar.c    |  49 ++++++---------
>>   drivers/usb/gadget/f_fastboot.c |   7 +--
>>   include/fastboot.h              |  13 ----
>>   net/fastboot.c                  |   8 +--
>>   7 files changed, 82 insertions(+), 145 deletions(-)
>>
>> diff --git a/cmd/fastboot.c b/cmd/fastboot.c
>> index b498e4b22bb3..b94dbd548843 100644
>> --- a/cmd/fastboot.c
>> +++ b/cmd/fastboot.c
>> @@ -19,8 +19,14 @@
>>   static int do_fastboot_udp(int argc, char *const argv[],
>>                  uintptr_t buf_addr, size_t buf_size)
>>   {
>> -#if CONFIG_IS_ENABLED(UDP_FUNCTION_FASTBOOT)
> 
> Unrelated to this, don't we need to define Kconfig entries for 'config SPL_UDP_FUNCTION_FASTBOOT' and 'config TPL_UDP_FUNCTION_FASTBOOT' and the other macros tested in fastboot, so it would be correctly configurable in SPL ?

Is fastboot even supported in SPL? This should probably be IS_ENABLED.

--Sean


More information about the U-Boot mailing list