Author: hailfinger Date: 2008-02-14 23:34:40 +0100 (Thu, 14 Feb 2008) New Revision: 599
Modified: coreboot-v3/arch/x86/mc146818rtc.c coreboot-v3/arch/x86/speaker.c coreboot-v3/device/device.c coreboot-v3/device/pci_device.c coreboot-v3/device/pci_rom.c coreboot-v3/include/spinlock.h coreboot-v3/lib/console.c Log: Remove superfluous checks for boolean CONFIG_* variables where we tested CONFIG_* == 1. If those variables are set, they will always be 1.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net Acked-by: Stefan Reinauer stepan@coresystems.de
Modified: coreboot-v3/arch/x86/mc146818rtc.c =================================================================== --- coreboot-v3/arch/x86/mc146818rtc.c 2008-02-14 20:54:00 UTC (rev 598) +++ coreboot-v3/arch/x86/mc146818rtc.c 2008-02-14 22:34:40 UTC (rev 599) @@ -43,7 +43,7 @@ outb((val),RTC_PORT(1)); \ })
-#if defined(CONFIG_OPTION_TABLE) && (CONFIG_OPTION_TABLE == 1) +#ifdef CONFIG_OPTION_TABLE
static int rtc_checksum_valid(int range_start, int range_end, int cks_loc) { @@ -78,14 +78,14 @@
void rtc_init(int invalid) { -#if defined(CONFIG_OPTION_TABLE) && (CONFIG_OPTION_TABLE == 1) +#ifdef CONFIG_OPTION_TABLE unsigned char x; int cmos_invalid, checksum_invalid; #endif
printk(BIOS_DEBUG, "Initializing realtime clock.\n");
-#if defined(CONFIG_OPTION_TABLE) && (CONFIG_OPTION_TABLE == 1) +#ifdef CONFIG_OPTION_TABLE
/* See if there has been a CMOS power problem. */ x = CMOS_READ(RTC_VALID); @@ -127,7 +127,7 @@ /* Setup the frequency it operates at */ CMOS_WRITE(RTC_FREQ_SELECT_DEFAULT, RTC_FREQ_SELECT);
-#if defined(CONFIG_OPTION_TABLE) && (CONFIG_OPTION_TABLE == 1) +#ifdef CONFIG_OPTION_TABLE /* See if there is a coreboot CMOS checksum error */ checksum_invalid = !rtc_checksum_valid(CB_CKS_RANGE_START, CB_CKS_RANGE_END,CB_CKS_LOC); @@ -224,7 +224,7 @@ if(!rtc_checksum_valid(CB_CKS_RANGE_START, CB_CKS_RANGE_END,CB_CKS_LOC)) return(-4); -#if defined(CONFIG_OPTION_TABLE) && (CONFIG_OPTION_TABLE == 1) +#ifdef CONFIG_OPTION_TABLE return(0); #else return -2;
Modified: coreboot-v3/arch/x86/speaker.c =================================================================== --- coreboot-v3/arch/x86/speaker.c 2008-02-14 20:54:00 UTC (rev 598) +++ coreboot-v3/arch/x86/speaker.c 2008-02-14 22:34:40 UTC (rev 599) @@ -93,7 +93,7 @@ */ void beep_short(void) { -#if defined(CONFIG_BEEPS) && (CONFIG_BEEPS == 1) +#ifdef CONFIG_BEEPS speaker_tone(1760, 500); /* 1760 == note A6. */ #endif } @@ -103,7 +103,7 @@ */ void beep_long(void) { -#if defined(CONFIG_BEEPS) && (CONFIG_BEEPS == 1) +#ifdef CONFIG_BEEPS speaker_tone(1760, 2000); /* 1760 == note A6. */ #endif }
Modified: coreboot-v3/device/device.c =================================================================== --- coreboot-v3/device/device.c 2008-02-14 20:54:00 UTC (rev 598) +++ coreboot-v3/device/device.c 2008-02-14 22:34:40 UTC (rev 599) @@ -534,7 +534,7 @@ base, bridge->size, bridge->align, bridge->gran); }
-#if defined(CONFIG_PCI_OPTION_ROM_RUN) && CONFIG_PCI_OPTION_ROM_RUN == 1 +#ifdef CONFIG_PCI_OPTION_ROM_RUN struct device *vga_pri = 0; int vga_inited = 0; static void allocate_vga_resource(void) @@ -580,8 +580,7 @@ if (!vga) { vga = vga_first; } -#if defined(CONFIG_INITIALIZE_ONBOARD_VGA_FIRST) && \ - CONFIG_INITIALIZE_ONBOARD_VGA_FIRST == 1 +#ifdef CONFIG_INITIALIZE_ONBOARD_VGA_FIRST if (vga_onboard) // Will use on board VGA as pri. #else if (!vga) // Will use last add on adapter as pri. @@ -919,7 +918,7 @@ mem->flags |= IORESOURCE_ASSIGNED; mem->flags &= ~IORESOURCE_STORED;
-#if defined(CONFIG_PCI_OPTION_ROM_RUN) && CONFIG_PCI_OPTION_ROM_RUN == 1 +#ifdef CONFIG_PCI_OPTION_ROM_RUN /* Allocate the VGA I/O resource. */ allocate_vga_resource(); #endif
Modified: coreboot-v3/device/pci_device.c =================================================================== --- coreboot-v3/device/pci_device.c 2008-02-14 20:54:00 UTC (rev 598) +++ coreboot-v3/device/pci_device.c 2008-02-14 22:34:40 UTC (rev 599) @@ -689,7 +689,7 @@ void pci_dev_init(struct device *dev) { printk(BIOS_SPEW, "PCI: pci_dev_init\n"); -#if defined(CONFIG_PCI_OPTION_ROM_RUN) && CONFIG_PCI_OPTION_ROM_RUN == 1 +#ifdef CONFIG_PCI_OPTION_ROM_RUN void run_bios(struct device *dev, unsigned long addr); struct rom_header *rom, *ram;
Modified: coreboot-v3/device/pci_rom.c =================================================================== --- coreboot-v3/device/pci_rom.c 2008-02-14 20:54:00 UTC (rev 598) +++ coreboot-v3/device/pci_rom.c 2008-02-14 22:34:40 UTC (rev 599) @@ -105,7 +105,7 @@
static void *pci_ram_image_start = (void *)PCI_RAM_IMAGE_START;
-#if defined(CONFIG_PCI_OPTION_ROM_RUN) && CONFIG_PCI_OPTION_ROM_RUN == 1 +#ifdef CONFIG_PCI_OPTION_ROM_RUN extern int vga_inited; // Defined in vga_console.c. #ifndef CONFIG_MULTIPLE_VGA_INIT extern struct device *vga_pri; // The primary VGA device, defined in device.c. @@ -135,7 +135,7 @@ rom_size = rom_header->size * 512;
if (PCI_CLASS_DISPLAY_VGA == rom_data->class_hi) { -#if defined(CONFIG_PCI_OPTION_ROM_RUN) && CONFIG_PCI_OPTION_ROM_RUN == 1 +#ifdef CONFIG_PCI_OPTION_ROM_RUN #ifndef CONFIG_MULTIPLE_VGA_INIT if (dev != vga_pri) return NULL; // Only one VGA supported.
Modified: coreboot-v3/include/spinlock.h =================================================================== --- coreboot-v3/include/spinlock.h 2008-02-14 20:54:00 UTC (rev 598) +++ coreboot-v3/include/spinlock.h 2008-02-14 22:34:40 UTC (rev 599) @@ -23,7 +23,7 @@ #ifndef SPINLOCK_H #define SPINLOCK_H
-#if defined(CONFIG_SMP) && CONFIG_SMP == 1 +#ifdef CONFIG_SMP
#include <arch/spinlock.h>
Modified: coreboot-v3/lib/console.c =================================================================== --- coreboot-v3/lib/console.c 2008-02-14 20:54:00 UTC (rev 598) +++ coreboot-v3/lib/console.c 2008-02-14 22:34:40 UTC (rev 599) @@ -89,7 +89,7 @@ #ifdef CONFIG_CONSOLE_SERIAL if (byte == '\n') { uart8250_tx_byte(TTYSx_BASE, '\r'); -#if defined(CONFIG_CONSOLE_PREFIX) && (CONFIG_CONSOLE_PREFIX == 1) +#ifdef CONFIG_CONSOLE_PREFIX uart8250_tx_byte(TTYSx_BASE, '\n'); uart8250_tx_byte(TTYSx_BASE, '('); uart8250_tx_byte(TTYSx_BASE, 'L');