coreinfo: Use IS_ENABLED() to query Kconfig variables
This will make the code work with the different styles of Kconfig (emit unset bools vs don't emit unset bools) Roughly, the patch does this, and a little bit of fixing up: perl -pi -e 's,ifdef (CONFIG_.+?)\b,if IS_ENABLED\($1\),g' `find . -name *.[ch]` perl -pi -e 's,ifndef (CONFIG_.+?)\b,if !IS_ENABLED\($1\),g' `find . -name *.[ch]` Change-Id: Ia461a33541f58ff39e984119c44ece7e6c05608a Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/10713 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
		@@ -19,7 +19,7 @@
 | 
			
		||||
 | 
			
		||||
#include "coreinfo.h"
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_MODULE_BOOTLOG
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_BOOTLOG)
 | 
			
		||||
 | 
			
		||||
#define CONFIG_COREBOOT_PRINTK_BUFFER_ADDR 0x90000
 | 
			
		||||
#define CONFIG_COREBOOT_PRINTK_BUFFER_SIZE 65536
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,7 @@
 | 
			
		||||
#include "coreinfo.h"
 | 
			
		||||
#include "endian.h"
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_MODULE_CBFS
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_CBFS)
 | 
			
		||||
 | 
			
		||||
#define ALIGN(_v, _a) (((_v) + ((_a) - 1)) & ~((_a) - 1))
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,7 @@
 | 
			
		||||
#include "coreinfo.h"
 | 
			
		||||
#include <coreboot_tables.h>
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_MODULE_COREBOOT
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_COREBOOT)
 | 
			
		||||
 | 
			
		||||
#define MAX_MEMORY_COUNT 5
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -35,34 +35,34 @@ extern struct coreinfo_module lar_module;
 | 
			
		||||
extern struct coreinfo_module cbfs_module;
 | 
			
		||||
 | 
			
		||||
struct coreinfo_module *system_modules[] = {
 | 
			
		||||
#ifdef CONFIG_MODULE_CPUINFO
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_CPUINFO)
 | 
			
		||||
	&cpuinfo_module,
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef CONFIG_MODULE_PCI
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_PCI)
 | 
			
		||||
	&pci_module,
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef CONFIG_MODULE_NVRAM
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_NVRAM)
 | 
			
		||||
	&nvram_module,
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef CONFIG_MODULE_RAMDUMP
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_RAMDUMP)
 | 
			
		||||
	&ramdump_module,
 | 
			
		||||
#endif
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct coreinfo_module *firmware_modules[] = {
 | 
			
		||||
#ifdef CONFIG_MODULE_COREBOOT
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_COREBOOT)
 | 
			
		||||
	&coreboot_module,
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef CONFIG_MODULE_MULTIBOOT
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_MULTIBOOT)
 | 
			
		||||
	&multiboot_module,
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef CONFIG_MODULE_BOOTLOG
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_BOOTLOG)
 | 
			
		||||
	&bootlog_module,
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef CONFIG_MODULE_LAR
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_LAR)
 | 
			
		||||
	&lar_module,
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef CONFIG_MODULE_CBFS
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_CBFS)
 | 
			
		||||
	&cbfs_module,
 | 
			
		||||
#endif
 | 
			
		||||
};
 | 
			
		||||
@@ -121,7 +121,7 @@ static void print_submenu(struct coreinfo_cat *cat)
 | 
			
		||||
	mvwprintw(menuwin, 0, 0, menu);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_SHOW_DATE_TIME
 | 
			
		||||
#if IS_ENABLED(CONFIG_SHOW_DATE_TIME)
 | 
			
		||||
static void print_time_and_date(void)
 | 
			
		||||
{
 | 
			
		||||
	struct tm tm;
 | 
			
		||||
@@ -156,7 +156,7 @@ static void print_menu(void)
 | 
			
		||||
 | 
			
		||||
	mvwprintw(menuwin, 1, 0, menu);
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_SHOW_DATE_TIME
 | 
			
		||||
#if IS_ENABLED(CONFIG_SHOW_DATE_TIME)
 | 
			
		||||
	print_time_and_date();
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
@@ -234,7 +234,7 @@ static void loop(void)
 | 
			
		||||
	halfdelay(10);
 | 
			
		||||
 | 
			
		||||
	while (1) {
 | 
			
		||||
#ifdef CONFIG_SHOW_DATE_TIME
 | 
			
		||||
#if IS_ENABLED(CONFIG_SHOW_DATE_TIME)
 | 
			
		||||
		print_time_and_date();
 | 
			
		||||
		wrefresh(menuwin);
 | 
			
		||||
#endif
 | 
			
		||||
@@ -271,7 +271,7 @@ int main(void)
 | 
			
		||||
{
 | 
			
		||||
	int i, j;
 | 
			
		||||
 | 
			
		||||
#if defined(CONFIG_USB)
 | 
			
		||||
#if IS_ENABLED(CONFIG_LP_USB)
 | 
			
		||||
	usb_initialize();
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@
 | 
			
		||||
 | 
			
		||||
#include "coreinfo.h"
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_MODULE_CPUINFO
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_CPUINFO)
 | 
			
		||||
#include <arch/rdtsc.h>
 | 
			
		||||
 | 
			
		||||
#define VENDOR_INTEL 0x756e6547
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@
 | 
			
		||||
 | 
			
		||||
#include "coreinfo.h"
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_MODULE_LAR
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_LAR)
 | 
			
		||||
 | 
			
		||||
static struct LAR *lar;
 | 
			
		||||
static int lcount, selected;
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,7 @@
 | 
			
		||||
#include <multiboot_tables.h>
 | 
			
		||||
#include "coreinfo.h"
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_MODULE_MULTIBOOT
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_MULTIBOOT)
 | 
			
		||||
 | 
			
		||||
#define MAX_MEMORY_COUNT  10
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@
 | 
			
		||||
 | 
			
		||||
#include "coreinfo.h"
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_MODULE_NVRAM
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_NVRAM)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Dump 256 bytes of NVRAM.
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@
 | 
			
		||||
#include <libpayload.h>
 | 
			
		||||
#include "coreinfo.h"
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_MODULE_PCI
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_PCI)
 | 
			
		||||
 | 
			
		||||
struct pci_devices {
 | 
			
		||||
	pcidev_t device;
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@
 | 
			
		||||
 | 
			
		||||
#include "coreinfo.h"
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_MODULE_RAMDUMP
 | 
			
		||||
#if IS_ENABLED(CONFIG_MODULE_RAMDUMP)
 | 
			
		||||
 | 
			
		||||
static s64 cursor = 0;
 | 
			
		||||
static s64 cursor_max = (1 * 1024 * 1024 * 1024); /* Max. 1 GB RAM for now. */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user