[U-Boot] [PATCH 16/16] efi_loader: consistently use efi_handle_t for handles

Heinrich Schuchardt xypron.glpk at gmx.de
Mon Jan 8 23:21:57 UTC 2018


On 01/08/2018 04:37 AM, Simon Glass wrote:
> On 17 December 2017 at 08:43, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>> We should consistently use the efi_handle_t typedef when
>> referring to handles.
>>
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
>> ---
>>   cmd/bootefi.c                 | 10 ++++-----
>>   include/efi_api.h             | 20 ++++++++++--------
>>   include/efi_loader.h          | 14 +++++++------
>>   lib/efi_loader/efi_boottime.c | 49 +++++++++++++++++++++++--------------------
>>   lib/efi_loader/efi_console.c  |  6 +++---
>>   5 files changed, 53 insertions(+), 46 deletions(-)
>>
> 
> Reviewed-by: Simon Glass <sjg at chromium.org>
> 
> [...]
> 
>> diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
>> index 98497db612..56b079cee8 100644
>> --- a/lib/efi_loader/efi_console.c
>> +++ b/lib/efi_loader/efi_console.c
>> @@ -503,21 +503,21 @@ int efi_console_register(void)
>>          struct efi_object *efi_console_input_obj;
>>
>>          /* Create handles */
>> -       r = efi_create_handle((void **)&efi_console_control_obj);
>> +       r = efi_create_handle((efi_handle_t *)&efi_console_control_obj);
> 
> How come we need this cast?

Without any cast we get
"warning: passing argument 1 of ‘efi_create_handle’ from incompatible 
pointer type"

In most cases efi_handle_t is a (void *) pointer to a struct efi_object. 
But there is at least an exception for loaded images.

I would prefer if we could eliminate this insane duality. But that will 
need some careful cleanup.

Best regards

Heinrich

> 
> Regards,
> Simon
> 



More information about the U-Boot mailing list