[coreboot-gerrit] Change in coreboot[master]: src/console: add IS_ENABLED() around Kconfig symbol references
Martin Roth (Code Review)
gerrit at coreboot.org
Fri Jun 9 17:26:28 CEST 2017
Martin Roth has uploaded this change for review. ( https://review.coreboot.org/20130
Change subject: src/console: add IS_ENABLED() around Kconfig symbol references
......................................................................
src/console: 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: I5a674cd7a360a0dd040c859ec1f8d760d7c83364
Signed-off-by: Martin Roth <martinroth at google.com>
---
M src/console/console.c
M src/console/init.c
M src/console/post.c
3 files changed, 14 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/30/20130/1
diff --git a/src/console/console.c b/src/console/console.c
index 877c8dc..16c041e 100644
--- a/src/console/console.c
+++ b/src/console/console.c
@@ -80,7 +80,7 @@
}
-#if CONFIG_GDB_STUB && (ENV_ROMSTAGE || ENV_RAMSTAGE)
+#if IS_ENABLED(CONFIG_GDB_STUB) && (ENV_ROMSTAGE || ENV_RAMSTAGE)
void gdb_hw_init(void)
{
__gdb_hw_init();
diff --git a/src/console/init.c b/src/console/init.c
index 1029e6b..c1565a4 100644
--- a/src/console/init.c
+++ b/src/console/init.c
@@ -33,7 +33,7 @@
static inline int get_log_level(void)
{
- if (CONSOLE_LEVEL_CONST)
+ if (IS_ENABLED(CONSOLE_LEVEL_CONST))
return CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
return console_loglevel;
@@ -65,7 +65,7 @@
{
init_log_level();
-#if CONFIG_EARLY_PCI_BRIDGE && !defined(__SMM__)
+#if IS_ENABLED(CONFIG_EARLY_PCI_BRIDGE) && !defined(__SMM__)
pci_early_bridge_init();
#endif
diff --git a/src/console/post.c b/src/console/post.c
index 481a1f4..e7e9147 100644
--- a/src/console/post.c
+++ b/src/console/post.c
@@ -38,7 +38,7 @@
#define mainboard_post(x)
#endif
-#if CONFIG_CMOS_POST
+#if IS_ENABLED(CONFIG_CMOS_POST)
DECLARE_SPIN_LOCK(cmos_post_lock)
@@ -46,7 +46,7 @@
void cmos_post_log(void)
{
u8 code = 0;
-#if CONFIG_CMOS_POST_EXTRA
+#if IS_ENABLED(CONFIG_CMOS_POST_EXTRA)
u32 extra = 0;
#endif
@@ -56,13 +56,13 @@
switch (cmos_read(CMOS_POST_BANK_OFFSET)) {
case CMOS_POST_BANK_0_MAGIC:
code = cmos_read(CMOS_POST_BANK_1_OFFSET);
-#if CONFIG_CMOS_POST_EXTRA
+#if IS_ENABLED(CONFIG_CMOS_POST_EXTRA)
extra = cmos_read32(CMOS_POST_BANK_1_EXTRA);
#endif
break;
case CMOS_POST_BANK_1_MAGIC:
code = cmos_read(CMOS_POST_BANK_0_OFFSET);
-#if CONFIG_CMOS_POST_EXTRA
+#if IS_ENABLED(CONFIG_CMOS_POST_EXTRA)
extra = cmos_read32(CMOS_POST_BANK_0_EXTRA);
#endif
break;
@@ -80,9 +80,9 @@
default:
printk(BIOS_WARNING, "POST: Unexpected post code "
"in previous boot: 0x%02x\n", code);
-#if CONFIG_ELOG
+#if IS_ENABLED(CONFIG_ELOG)
elog_add_event_word(ELOG_TYPE_LAST_POST_CODE, code);
-#if CONFIG_CMOS_POST_EXTRA
+#if IS_ENABLED(CONFIG_CMOS_POST_EXTRA)
if (extra)
elog_add_event_dword(ELOG_TYPE_POST_EXTRA, extra);
#endif
@@ -90,7 +90,7 @@
}
}
-#if CONFIG_CMOS_POST_EXTRA
+#if IS_ENABLED(CONFIG_CMOS_POST_EXTRA)
void post_log_extra(u32 value)
{
spin_lock(&cmos_post_lock);
@@ -144,14 +144,14 @@
void post_code(uint8_t value)
{
-#if !CONFIG_NO_POST
-#if CONFIG_CONSOLE_POST
+#if !IS_ENABLED(CONFIG_NO_POST)
+#if IS_ENABLED(CONFIG_CONSOLE_POST)
printk(BIOS_EMERG, "POST: 0x%02x\n", value);
#endif
-#if CONFIG_CMOS_POST
+#if IS_ENABLED(CONFIG_CMOS_POST)
cmos_post_code(value);
#endif
-#if CONFIG_POST_IO
+#if IS_ENABLED(CONFIG_POST_IO)
outb(value, CONFIG_POST_IO_PORT);
#endif
#endif
--
To view, visit https://review.coreboot.org/20130
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a674cd7a360a0dd040c859ec1f8d760d7c83364
Gerrit-Change-Number: 20130
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth at google.com>
More information about the coreboot-gerrit
mailing list