lkml.org 
[lkml]   [2018]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v14 2/5] x86/boot: Introduce efi_get_rsdp_addr() to find RSDP from EFI table

* Ingo Molnar <mingo@kernel.org> wrote:

> > + if (!(efi_guidcmp(guid, ACPI_TABLE_GUID)))
> > + rsdp_addr = (acpi_physical_address)table;
> > + else if (!(efi_guidcmp(guid, ACPI_20_TABLE_GUID)))
> > + return (acpi_physical_address)table;
>
> 'return' is not a function.

Disregard this - I got confused by the type cast.

The type cast is ugly nevertheless. 'table' is an 'unsigned long'.

So 'acpi_physical_address' is basically an u64/u32, depending on
ACPI_MACHINE_WIDTH, right?

Since this is x86, can ACPI_MACHINE_WIDTH ever get out of sync with the
native 'unsigned long' size?

If not then why not make the return type 'unsigned long', instead of
'acpi_physical_address' that you have to wade through a couple of headers
to figure out its true size. Does that cause complications elsewhere?

I.e. the excessive type casts are ugly and make the code somewhat
fragile.

Thanks,

Ingo

\
 
 \ /
  Last update: 2018-12-17 18:36    [W:0.122 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site