Re: [PATCH v14 3/5] x86/boot: Introduce bios_get_rsdp_addr() to search RSDP in memory

From: Ingo Molnar
Date: Mon Dec 17 2018 - 12:38:45 EST



* Chao Fan <fanc.fnst@xxxxxxxxxxxxxx> wrote:

> + /* Check the standard checksum */
> + if (compute_checksum((u8 *) rsdp, ACPI_RSDP_CHECKSUM_LENGTH))
> + continue;

Could you please run your patches through checkpatch, does it not
complain about this line?

> +/* Search RSDP address, based on acpi_find_root_pointer(). */
> +static acpi_physical_address bios_get_rsdp_addr(void)
> +{
> + u8 *table_ptr;
> + u32 address;
> + u8 *rsdp;
> +
> + /* Get the location of the Extended BIOS Data Area (EBDA) */
> + table_ptr = (u8 *)ACPI_EBDA_PTR_LOCATION;
> + *(u32 *)(void *)&address = *(u16 *)(void *)table_ptr;

what? So you take the address of 'u32 address', which turns it into an
u32 * - then you cast it to void *, then back to u32 * and then deference
it???

Thanks,

Ingo