diff --git a/arch/x86/mc146818rtc.c b/arch/x86/mc146818rtc.c index e945de753c..cfe7888179 100644 --- a/arch/x86/mc146818rtc.c +++ b/arch/x86/mc146818rtc.c @@ -43,7 +43,7 @@ outb((addr),RTC_PORT(0)); \ 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 @@ static void rtc_set_checksum(int range_start, int range_end, int cks_loc) 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 @@ void rtc_init(int invalid) /* 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 @@ int get_option(void *dest, char *name) 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; diff --git a/arch/x86/speaker.c b/arch/x86/speaker.c index a28024af37..95c262ad70 100644 --- a/arch/x86/speaker.c +++ b/arch/x86/speaker.c @@ -93,7 +93,7 @@ void speaker_tone(u16 freq, unsigned int duration) */ 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_short(void) */ void beep_long(void) { -#if defined(CONFIG_BEEPS) && (CONFIG_BEEPS == 1) +#ifdef CONFIG_BEEPS speaker_tone(1760, 2000); /* 1760 == note A6. */ #endif } diff --git a/device/device.c b/device/device.c index 246664a4df..53a6292734 100644 --- a/device/device.c +++ b/device/device.c @@ -534,7 +534,7 @@ void compute_allocate_resource(struct bus *bus, struct resource *bridge, 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 @@ static void allocate_vga_resource(void) 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 @@ void dev_phase4(void) 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 diff --git a/device/pci_device.c b/device/pci_device.c index 3c66d57191..c2b2f8ba27 100644 --- a/device/pci_device.c +++ b/device/pci_device.c @@ -689,7 +689,7 @@ void pci_dev_set_subsystem(struct device *dev, unsigned int vendor, 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; diff --git a/device/pci_rom.c b/device/pci_rom.c index e9e6c5106e..0a12ee0f40 100644 --- a/device/pci_rom.c +++ b/device/pci_rom.c @@ -105,7 +105,7 @@ struct rom_header *pci_rom_probe(struct device *dev) 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 @@ struct rom_header *pci_rom_load(struct device *dev, 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. diff --git a/include/spinlock.h b/include/spinlock.h index 2019586f4b..a42061cb9d 100644 --- a/include/spinlock.h +++ b/include/spinlock.h @@ -23,7 +23,7 @@ #ifndef SPINLOCK_H #define SPINLOCK_H -#if defined(CONFIG_SMP) && CONFIG_SMP == 1 +#ifdef CONFIG_SMP #include diff --git a/lib/console.c b/lib/console.c index 943185a5b6..322532d707 100644 --- a/lib/console.c +++ b/lib/console.c @@ -89,7 +89,7 @@ void console_tx_byte(unsigned char byte, void *arg) #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');