[coreboot-gerrit] Change in coreboot[master]: src/drivers: add IS_ENABLED() around Kconfig symbol references
Martin Roth (Code Review)
gerrit at coreboot.org
Sun Jun 25 21:07:29 CEST 2017
Martin Roth has uploaded this change for review. ( https://review.coreboot.org/20352
Change subject: src/drivers: add IS_ENABLED() around Kconfig symbol references
......................................................................
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 at google.com>
---
M src/drivers/elog/boot_count.c
M src/drivers/elog/elog.c
M src/drivers/intel/gma/int15.h
M src/drivers/pc80/pc/i8254.c
M src/drivers/pc80/rtc/mc146818rtc.c
M src/drivers/pc80/rtc/mc146818rtc_romcc.c
M src/drivers/uart/util.c
M src/drivers/usb/ehci_debug.c
8 files changed, 19 insertions(+), 19 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/52/20352/1
diff --git a/src/drivers/elog/boot_count.c b/src/drivers/elog/boot_count.c
index 9d717d8..8988287 100644
--- a/src/drivers/elog/boot_count.c
+++ b/src/drivers/elog/boot_count.c
@@ -26,7 +26,7 @@
* This can either be declared as part of the option
* table or statically defined in the board config.
*/
-#if CONFIG_USE_OPTION_TABLE
+#if IS_ENABLED(CONFIG_USE_OPTION_TABLE)
# include "option_table.h"
# define BOOT_COUNT_CMOS_OFFSET (CMOS_VSTART_boot_count_offset >> 3)
#else
diff --git a/src/drivers/elog/elog.c b/src/drivers/elog/elog.c
index 27b6e29..1c17561 100644
--- a/src/drivers/elog/elog.c
+++ b/src/drivers/elog/elog.c
@@ -13,13 +13,13 @@
* GNU General Public License for more details.
*/
-#if CONFIG_HAVE_ACPI_RESUME == 1
+#if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)
#include <arch/acpi.h>
#endif
#include <bootstate.h>
#include <cbmem.h>
#include <console/console.h>
-#if CONFIG_ARCH_X86
+#if IS_ENABLED(CONFIG_ARCH_X86)
#include <pc80/mc146818rtc.h>
#endif
#include <bcd.h>
@@ -786,8 +786,8 @@
#if !defined(__SMM__)
/* Log boot count event except in S3 resume */
-#if CONFIG_ELOG_BOOT_COUNT == 1
-#if CONFIG_HAVE_ACPI_RESUME == 1
+#if IS_ENABLED(CONFIG_ELOG_BOOT_COUNT)
+#if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)
if (!acpi_is_wakeup_s3())
#endif
elog_add_event_dword(ELOG_TYPE_BOOT, boot_count_read());
@@ -796,9 +796,9 @@
elog_add_event_dword(ELOG_TYPE_BOOT, 0);
#endif
-#if CONFIG_ARCH_X86
+#if IS_ENABLED(CONFIG_ARCH_X86)
/* Check and log POST codes from previous boot */
- if (CONFIG_CMOS_POST)
+ if (IS_ENABLED(CONFIG_CMOS_POST))
cmos_post_log();
#endif
#endif
diff --git a/src/drivers/intel/gma/int15.h b/src/drivers/intel/gma/int15.h
index db83f6a..4a445e5 100644
--- a/src/drivers/intel/gma/int15.h
+++ b/src/drivers/intel/gma/int15.h
@@ -26,7 +26,7 @@
};
-#if CONFIG_VGA_ROM_RUN
+#if IS_ENABLED(CONFIG_VGA_ROM_RUN)
/* Install custom int15 handler for VGA OPROM */
void install_intel_vga_int15_handler(int active_lfp, int pfit, int display, int panel_type);
#else
diff --git a/src/drivers/pc80/pc/i8254.c b/src/drivers/pc80/pc/i8254.c
index 5851ec0..eb91bf6 100644
--- a/src/drivers/pc80/pc/i8254.c
+++ b/src/drivers/pc80/pc/i8254.c
@@ -32,7 +32,7 @@
outb(0x12, TIMER1_PORT);
}
-#if CONFIG_UDELAY_TIMER2
+#if IS_ENABLED(CONFIG_UDELAY_TIMER2)
static void load_timer2(unsigned int ticks)
{
/* Set up the timer gate, turn off the speaker */
diff --git a/src/drivers/pc80/rtc/mc146818rtc.c b/src/drivers/pc80/rtc/mc146818rtc.c
index 33860b8..0e9a88a 100644
--- a/src/drivers/pc80/rtc/mc146818rtc.c
+++ b/src/drivers/pc80/rtc/mc146818rtc.c
@@ -28,7 +28,7 @@
#include <cbfs.h>
/* 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"
#else
#define LB_CKS_RANGE_START 0
diff --git a/src/drivers/pc80/rtc/mc146818rtc_romcc.c b/src/drivers/pc80/rtc/mc146818rtc_romcc.c
index 8bebc42..dc4f2ef 100644
--- a/src/drivers/pc80/rtc/mc146818rtc_romcc.c
+++ b/src/drivers/pc80/rtc/mc146818rtc_romcc.c
@@ -1,7 +1,7 @@
#include <stdint.h>
#include <pc80/mc146818rtc.h>
#include <fallback.h>
-#if CONFIG_USE_OPTION_TABLE
+#if IS_ENABLED(CONFIG_USE_OPTION_TABLE)
#include "option_table.h"
#endif
@@ -19,7 +19,7 @@
static int cmos_chksum_valid(void)
{
-#if CONFIG_USE_OPTION_TABLE
+#if IS_ENABLED(CONFIG_USE_OPTION_TABLE)
unsigned char addr;
u16 sum, old_sum;
@@ -93,7 +93,7 @@
unsigned read_option_lowlevel(unsigned start, unsigned size, unsigned def)
{
-#if CONFIG_USE_OPTION_TABLE
+#if IS_ENABLED(CONFIG_USE_OPTION_TABLE)
unsigned byte;
byte = cmos_read(start/8);
diff --git a/src/drivers/uart/util.c b/src/drivers/uart/util.c
index e1b83ba..f0f885d 100644
--- a/src/drivers/uart/util.c
+++ b/src/drivers/uart/util.c
@@ -13,14 +13,14 @@
#include <console/console.h>
#include <console/uart.h>
-#if CONFIG_USE_OPTION_TABLE
+#if IS_ENABLED(CONFIG_USE_OPTION_TABLE)
#include <option.h>
#include "option_table.h"
#endif
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] =
{ 115200, 57600, 38400, 19200, 9600, 4800, 2400, 1200 };
unsigned b_index = 0;
diff --git a/src/drivers/usb/ehci_debug.c b/src/drivers/usb/ehci_debug.c
index cac043e..6fcf683 100644
--- a/src/drivers/usb/ehci_debug.c
+++ b/src/drivers/usb/ehci_debug.c
@@ -33,7 +33,7 @@
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 int dbgp_enabled(void);
# define dprintk(LEVEL, args...) \
@@ -197,7 +197,7 @@
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)
{
u32 ctrl = read32(&ehci_debug->control);
@@ -578,7 +578,7 @@
//return ret;
next_debug_port:
-#if CONFIG_USBDEBUG_DEFAULT_PORT==0
+#if CONFIG_USBDEBUG_DEFAULT_PORT == 0
port_map_tried |= (1 << (debug_port - 1));
new_debug_port = ((debug_port-1 + 1) % n_ports) + 1;
if (port_map_tried != ((1 << n_ports) - 1)) {
@@ -599,7 +599,7 @@
return -10;
}
-#if CONFIG_DEBUG_USBDEBUG
+#if IS_ENABLED(CONFIG_DEBUG_USBDEBUG)
static int dbgp_enabled(void)
{
struct dbgp_pipe *globals = &dbgp_ehci_info()->ep_pipe[DBGP_SETUP_EP0];
--
To view, visit https://review.coreboot.org/20352
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib3a1cf04482a8f19b159c31cfb16a7b492748d91
Gerrit-Change-Number: 20352
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170625/98b12677/attachment.html>
More information about the coreboot-gerrit
mailing list