[flashrom] [PATCH] Compile fixes

Michael Karcher flashrom at mkarcher.dialup.fu-berlin.de
Mon Mar 7 14:52:03 CET 2011


Am Montag, den 07.03.2011, 12:10 +0100 schrieb Carl-Daniel Hailfinger:
> Fix compilation if CONFIG_INTERNAL=no.
> Fix compilation if everything except CONFIG_SATAMV is no.
> Do not compile in PCI support for wiki printing if no PCI devices are
> supported.
I assume you tested the compilation. Your changes look sensible.

> Note: The flashrom.c hunk is ugly. Suggestions how to solve the ugliness
> are appreciated.
My suggestion: Remove the braces. Still kind-of ugly, but I also have no
idea how to avoid that cleanly. An idea would be to define a dummy
function physmap that does nothing in case we don't need the real
physmap. But in fact we really want the whole if/snprintf go away, so it
looks like we have to do the #ifdef stuff.


> +#if CONFIG_NIC3COM+CONFIG_NICREALTEK+CONFIG_NICNATSEMI+CONFIG_GFXNVIDIA+CONFIG_DRKAISER+CONFIG_SATASII+CONFIG_ATAHPT+CONFIG_NICINTEL_SPI+CONFIG_OGP_SPI+CONFIG_SATAMV >= 1
We have this #if condition twice. Maybe we should define a
"INCLUDE_PCIDEV" define from this condition in some header file?

> +#if CONFIG_INTERNAL == 1
>  	if (programmer_table[programmer].map_flash_region == physmap) {
>  		snprintf(location, sizeof(location), "at physical address 0x%lx", base);
> -	} else { 
> +	} else
> +#endif
> +	{ 
>  		snprintf(location, sizeof(location), "on %s", programmer_table[programmer].name);

Acked-by: Michael Karcher <flashrom at mkarcher.dialup.fu-berlin.de>

Regards,
  Michael Karcher





More information about the flashrom mailing list