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> 


git-svn-id: svn://coreboot.org/repository/coreboot-v3@599 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
Carl-Daniel Hailfinger 2008-02-14 22:34:40 +00:00
parent 92d588b146
commit c764701a53
7 changed files with 15 additions and 16 deletions

View file

@ -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;

View file

@ -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
}

View file

@ -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

View file

@ -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;

View file

@ -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.

View file

@ -23,7 +23,7 @@
#ifndef SPINLOCK_H
#define SPINLOCK_H
#if defined(CONFIG_SMP) && CONFIG_SMP == 1
#ifdef CONFIG_SMP
#include <arch/spinlock.h>

View file

@ -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');