src/drivers: add IS_ENABLED() around Kconfig symbol references

Some of these can be changed from #if to if(), but that will happen
in a follow-on commmit.

Change-Id: Ib3a1cf04482a8f19b159c31cfb16a7b492748d91
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/20352
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Martin Roth 2017-06-24 14:07:25 -06:00
parent e6ff1596e7
commit 32c27c2f85
8 changed files with 19 additions and 19 deletions

View File

@ -27,7 +27,7 @@
* This can either be declared as part of the option * This can either be declared as part of the option
* table or statically defined in the board config. * table or statically defined in the board config.
*/ */
#if CONFIG_USE_OPTION_TABLE #if IS_ENABLED(CONFIG_USE_OPTION_TABLE)
# include "option_table.h" # include "option_table.h"
# define BOOT_COUNT_CMOS_OFFSET (CMOS_VSTART_boot_count_offset >> 3) # define BOOT_COUNT_CMOS_OFFSET (CMOS_VSTART_boot_count_offset >> 3)
#else #else

View File

@ -13,13 +13,13 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#if CONFIG_HAVE_ACPI_RESUME == 1 #if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)
#include <arch/acpi.h> #include <arch/acpi.h>
#endif #endif
#include <bootstate.h> #include <bootstate.h>
#include <cbmem.h> #include <cbmem.h>
#include <console/console.h> #include <console/console.h>
#if CONFIG_ARCH_X86 #if IS_ENABLED(CONFIG_ARCH_X86)
#include <pc80/mc146818rtc.h> #include <pc80/mc146818rtc.h>
#endif #endif
#include <bcd.h> #include <bcd.h>
@ -786,8 +786,8 @@ int elog_init(void)
#if !defined(__SMM__) #if !defined(__SMM__)
/* Log boot count event except in S3 resume */ /* Log boot count event except in S3 resume */
#if CONFIG_ELOG_BOOT_COUNT == 1 #if IS_ENABLED(CONFIG_ELOG_BOOT_COUNT)
#if CONFIG_HAVE_ACPI_RESUME == 1 #if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)
if (!acpi_is_wakeup_s3()) if (!acpi_is_wakeup_s3())
#endif #endif
elog_add_event_dword(ELOG_TYPE_BOOT, boot_count_read()); elog_add_event_dword(ELOG_TYPE_BOOT, boot_count_read());
@ -796,9 +796,9 @@ int elog_init(void)
elog_add_event_dword(ELOG_TYPE_BOOT, 0); elog_add_event_dword(ELOG_TYPE_BOOT, 0);
#endif #endif
#if CONFIG_ARCH_X86 #if IS_ENABLED(CONFIG_ARCH_X86)
/* Check and log POST codes from previous boot */ /* Check and log POST codes from previous boot */
if (CONFIG_CMOS_POST) if (IS_ENABLED(CONFIG_CMOS_POST))
cmos_post_log(); cmos_post_log();
#endif #endif
#endif #endif

View File

@ -26,7 +26,7 @@ enum {
}; };
#if CONFIG_VGA_ROM_RUN #if IS_ENABLED(CONFIG_VGA_ROM_RUN)
/* Install custom int15 handler for VGA OPROM */ /* Install custom int15 handler for VGA OPROM */
void install_intel_vga_int15_handler(int active_lfp, int pfit, int display, int panel_type); void install_intel_vga_int15_handler(int active_lfp, int pfit, int display, int panel_type);
#else #else

View File

@ -32,7 +32,7 @@ void setup_i8254(void)
outb(0x12, TIMER1_PORT); outb(0x12, TIMER1_PORT);
} }
#if CONFIG_UDELAY_TIMER2 #if IS_ENABLED(CONFIG_UDELAY_TIMER2)
static void load_timer2(unsigned int ticks) static void load_timer2(unsigned int ticks)
{ {
/* Set up the timer gate, turn off the speaker */ /* Set up the timer gate, turn off the speaker */

View File

@ -28,7 +28,7 @@
#include <cbfs.h> #include <cbfs.h>
/* There's no way around this include guard. option_table.h is autogenerated */ /* There's no way around this include guard. option_table.h is autogenerated */
#if CONFIG_USE_OPTION_TABLE #if IS_ENABLED(CONFIG_USE_OPTION_TABLE)
#include "option_table.h" #include "option_table.h"
#else #else
#define LB_CKS_RANGE_START 0 #define LB_CKS_RANGE_START 0

View File

@ -1,7 +1,7 @@
#include <stdint.h> #include <stdint.h>
#include <pc80/mc146818rtc.h> #include <pc80/mc146818rtc.h>
#include <fallback.h> #include <fallback.h>
#if CONFIG_USE_OPTION_TABLE #if IS_ENABLED(CONFIG_USE_OPTION_TABLE)
#include "option_table.h" #include "option_table.h"
#endif #endif
@ -19,7 +19,7 @@ static int cmos_error(void)
static int cmos_chksum_valid(void) static int cmos_chksum_valid(void)
{ {
#if CONFIG_USE_OPTION_TABLE #if IS_ENABLED(CONFIG_USE_OPTION_TABLE)
unsigned char addr; unsigned char addr;
u16 sum, old_sum; u16 sum, old_sum;
@ -93,7 +93,7 @@ static inline __attribute__((unused)) int do_normal_boot(void)
unsigned read_option_lowlevel(unsigned start, unsigned size, unsigned def) unsigned read_option_lowlevel(unsigned start, unsigned size, unsigned def)
{ {
#if CONFIG_USE_OPTION_TABLE #if IS_ENABLED(CONFIG_USE_OPTION_TABLE)
unsigned byte; unsigned byte;
byte = cmos_read(start/8); byte = cmos_read(start/8);

View File

@ -13,14 +13,14 @@
#include <console/console.h> #include <console/console.h>
#include <console/uart.h> #include <console/uart.h>
#if CONFIG_USE_OPTION_TABLE #if IS_ENABLED(CONFIG_USE_OPTION_TABLE)
#include <option.h> #include <option.h>
#include "option_table.h" #include "option_table.h"
#endif #endif
unsigned int default_baudrate(void) unsigned int default_baudrate(void)
{ {
#if !defined(__SMM__) && CONFIG_USE_OPTION_TABLE #if !defined(__SMM__) && IS_ENABLED(CONFIG_USE_OPTION_TABLE)
static const unsigned baud[8] = static const unsigned baud[8] =
{ 115200, 57600, 38400, 19200, 9600, 4800, 2400, 1200 }; { 115200, 57600, 38400, 19200, 9600, 4800, 2400, 1200 };
unsigned b_index = 0; unsigned b_index = 0;

View File

@ -33,7 +33,7 @@ struct ehci_debug_info {
struct dbgp_pipe ep_pipe[DBGP_MAX_ENDPOINTS]; struct dbgp_pipe ep_pipe[DBGP_MAX_ENDPOINTS];
}; };
#if CONFIG_DEBUG_USBDEBUG #if IS_ENABLED(CONFIG_DEBUG_USBDEBUG)
static void dbgp_print_data(struct ehci_dbg_port *ehci_debug); static void dbgp_print_data(struct ehci_dbg_port *ehci_debug);
static int dbgp_enabled(void); static int dbgp_enabled(void);
# define dprintk(LEVEL, args...) \ # define dprintk(LEVEL, args...) \
@ -197,7 +197,7 @@ static void dbgp_get_data(struct ehci_dbg_port *ehci_debug, void *buf, int size)
bytes[i] = (hi >> (8*(i - 4))) & 0xff; bytes[i] = (hi >> (8*(i - 4))) & 0xff;
} }
#if CONFIG_DEBUG_USBDEBUG #if IS_ENABLED(CONFIG_DEBUG_USBDEBUG)
static void dbgp_print_data(struct ehci_dbg_port *ehci_debug) static void dbgp_print_data(struct ehci_dbg_port *ehci_debug)
{ {
u32 ctrl = read32(&ehci_debug->control); u32 ctrl = read32(&ehci_debug->control);
@ -578,7 +578,7 @@ err:
//return ret; //return ret;
next_debug_port: next_debug_port:
#if CONFIG_USBDEBUG_DEFAULT_PORT==0 #if CONFIG_USBDEBUG_DEFAULT_PORT == 0
port_map_tried |= (1 << (debug_port - 1)); port_map_tried |= (1 << (debug_port - 1));
new_debug_port = ((debug_port-1 + 1) % n_ports) + 1; new_debug_port = ((debug_port-1 + 1) % n_ports) + 1;
if (port_map_tried != ((1 << n_ports) - 1)) { if (port_map_tried != ((1 << n_ports) - 1)) {
@ -599,7 +599,7 @@ next_debug_port:
return -10; return -10;
} }
#if CONFIG_DEBUG_USBDEBUG #if IS_ENABLED(CONFIG_DEBUG_USBDEBUG)
static int dbgp_enabled(void) static int dbgp_enabled(void)
{ {
struct dbgp_pipe *globals = &dbgp_ehci_info()->ep_pipe[DBGP_SETUP_EP0]; struct dbgp_pipe *globals = &dbgp_ehci_info()->ep_pipe[DBGP_SETUP_EP0];