[U-Boot] [PATCH 1/1] efi_loader: provide meaningful status code

Alexander Graf agraf at suse.de
Fri Jul 14 13:54:13 UTC 2017



On 14.07.17 15:47, Simon Glass wrote:
> Hi,
> 
> On 3 July 2017 at 06:21, Alexander Graf <agraf at suse.de> wrote:
>> On 06/25/2017 10:56 PM, Heinrich Schuchardt wrote:
>>>
>>> Currenty any EFI status other than EFI_SUCCESS is reported as
>>> Application terminated, r = -22
>>>
>>> With the patch the status code and its mnemonic is printed.
>>>
>>> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
>>
>>
>> While I think it's very useful to have the status code, I don't want to
>> waste 1kb of .rodata on every binary out there - that will only drive more
>> people to disable CONFIG_EFI_LOADER which is the opposite of what we want.
>>
>> Can you please respin without the string return for now? Maybe we can add a
>> CONFIG_EFI_LOADER_DEBUG option later on which gives us verbose printing on
>> demand on a few more bits.
> 
> I think the error messages are useful and would like to see this new
> option. Bonus points if they can be in lower case :-)

Ah, one thing I forgot to mention:

If we want to revive the string conversion, it's probably a good idea to 
do it using macros. Something like

#define EFI_STATUS_CASE(x) case x: return stringify(x)
switch(status_code) {
     EFI_STATUS_CASE(EFI_SUCCESS);
     EFI_STATUS_CASE(EFI_amazing_error);
}
#undef EFI_STATUS_CASE

That way we don't repeat the code twice ;).


Alex


More information about the U-Boot mailing list