[coreboot] New patch to review for coreboot: 9006830 Clean up use of CONFIG_ variables in coreboot_table.c

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Fri Mar 2 23:02:00 CET 2012


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/701

-gerrit

commit 90068304b17c7f0f7673c01ecf13d883e0467d24
Author: Stefan Reinauer <reinauer at chromium.org>
Date:   Mon Aug 15 11:26:35 2011 -0700

    Clean up use of CONFIG_ variables in coreboot_table.c
    
    CONFIG_ variables are used inconsistently within the file
    src/arch/x86/boot/coreboot_table.c. #ifdef will do the wrong
    thing if the option is disabled. #if (CONFIG_FOO == 1) is
    not needed.
    
    Change-Id: Ifcac6ceac5fb34b931281beae500023597b3533b
    Signed-off-by: Stefan Reinauer <reinauer at google.com>
---
 src/arch/x86/boot/coreboot_table.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/arch/x86/boot/coreboot_table.c b/src/arch/x86/boot/coreboot_table.c
index fc861a4..0bcae4c 100644
--- a/src/arch/x86/boot/coreboot_table.c
+++ b/src/arch/x86/boot/coreboot_table.c
@@ -29,11 +29,11 @@
 #include <version.h>
 #include <device/device.h>
 #include <stdlib.h>
-#if (CONFIG_USE_OPTION_TABLE == 1)
+#if CONFIG_USE_OPTION_TABLE
 #include <option_table.h>
 #include <cbfs.h>
 #endif
-#if (CONFIG_ADD_FDT == 1)
+#if CONFIG_ADD_FDT
 #include <fdt/fdt.h>
 #include <fdt/libfdt_env.h>
 #endif
@@ -178,7 +178,7 @@ static void lb_framebuffer(struct lb_header *header)
 #endif
 }
 
-#ifdef CONFIG_ADD_FDT
+#if CONFIG_ADD_FDT
 static void lb_fdt(struct lb_header *header)
 {
 	struct lb_fdt *fdt_record;
@@ -230,7 +230,7 @@ static struct lb_mainboard *lb_mainboard(struct lb_header *header)
 	return mainboard;
 }
 
-#if (CONFIG_USE_OPTION_TABLE == 1)
+#if CONFIG_USE_OPTION_TABLE
 static struct cmos_checksum *lb_cmos_checksum(struct lb_header *header)
 {
 	struct lb_record *rec;
@@ -544,7 +544,7 @@ static void add_lb_reserved(struct lb_memory *mem)
 		lb_add_rsvd_range, mem);
 }
 
-#if CONFIG_WRITE_HIGH_TABLES == 1
+#if CONFIG_WRITE_HIGH_TABLES
 extern uint64_t high_tables_base, high_tables_size;
 #endif
 
@@ -555,7 +555,7 @@ unsigned long write_coreboot_table(
 	struct lb_header *head;
 	struct lb_memory *mem;
 
-#if CONFIG_WRITE_HIGH_TABLES == 1
+#if CONFIG_WRITE_HIGH_TABLES
 	printk(BIOS_DEBUG, "Writing high table forward entry at 0x%08lx\n",
 			low_table_end);
 	head = lb_table_init(low_table_end);
@@ -591,7 +591,7 @@ unsigned long write_coreboot_table(
 	rom_table_end &= ~0xffff;
 	printk(BIOS_DEBUG, "0x%08lx \n", rom_table_end);
 
-#if (CONFIG_USE_OPTION_TABLE == 1)
+#if CONFIG_USE_OPTION_TABLE
 	{
 		struct cmos_option_table *option_table = cbfs_find_file("cmos_layout.bin", 0x1aa);
 		if (option_table) {
@@ -616,7 +616,7 @@ unsigned long write_coreboot_table(
 	lb_add_memory_range(mem, LB_MEM_TABLE,
 		rom_table_start, rom_table_end-rom_table_start);
 
-#if CONFIG_WRITE_HIGH_TABLES == 1
+#if CONFIG_WRITE_HIGH_TABLES
 	printk(BIOS_DEBUG, "Adding high table area\n");
 	// should this be LB_MEM_ACPI?
 	lb_add_memory_range(mem, LB_MEM_TABLE,
@@ -626,7 +626,7 @@ unsigned long write_coreboot_table(
 	/* Add reserved regions */
 	add_lb_reserved(mem);
 
-#if (CONFIG_HAVE_MAINBOARD_RESOURCES == 1)
+#if CONFIG_HAVE_MAINBOARD_RESOURCES
 	add_mainboard_resources(mem);
 #endif
 
@@ -649,7 +649,8 @@ unsigned long write_coreboot_table(
 	lb_strings(head);
 	/* Record our framebuffer */
 	lb_framebuffer(head);
-#ifdef CONFIG_ADD_FDT
+
+#if CONFIG_ADD_FDT
 	/*
 	 * Copy FDT from CBFS into the coreboot table possibly augmenting it
 	 * along the way.




More information about the coreboot mailing list