libpayload: Make Kconfig bools use IS_ENABLED()
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_LP_.+?)\b,if IS_ENABLED\($1\),g' `find . -name *.[ch]` perl -pi -e 's,ifndef (CONFIG_LP_.+?)\b,if !IS_ENABLED\($1\),g' `find . -name *.[ch]` Change-Id: Ib8a839b056a1f806a8597052e1b571ea3d18a79f Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/10711 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
@@ -41,7 +41,7 @@ static uint8_t serial_read_reg(int offset)
|
||||
{
|
||||
offset *= lib_sysinfo.serial->regwidth;
|
||||
|
||||
#ifdef CONFIG_LP_IO_ADDRESS_SPACE
|
||||
#if IS_ENABLED(CONFIG_LP_IO_ADDRESS_SPACE)
|
||||
if (!serial_is_mem_mapped)
|
||||
return inb(IOBASE + offset);
|
||||
else
|
||||
@@ -53,7 +53,7 @@ static void serial_write_reg(uint8_t val, int offset)
|
||||
{
|
||||
offset *= lib_sysinfo.serial->regwidth;
|
||||
|
||||
#ifdef CONFIG_LP_IO_ADDRESS_SPACE
|
||||
#if IS_ENABLED(CONFIG_LP_IO_ADDRESS_SPACE)
|
||||
if (!serial_is_mem_mapped)
|
||||
outb(val, IOBASE + offset);
|
||||
else
|
||||
@@ -61,7 +61,7 @@ static void serial_write_reg(uint8_t val, int offset)
|
||||
writeb(val, MEMBASE + offset);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LP_SERIAL_SET_SPEED
|
||||
#if IS_ENABLED(CONFIG_LP_SERIAL_SET_SPEED)
|
||||
static void serial_hardware_init(int speed, int word_bits,
|
||||
int parity, int stop_bits)
|
||||
{
|
||||
@@ -106,7 +106,7 @@ void serial_init(void)
|
||||
(lib_sysinfo.serial->type == CB_SERIAL_TYPE_MEMORY_MAPPED);
|
||||
|
||||
if (!serial_is_mem_mapped) {
|
||||
#ifdef CONFIG_LP_IO_ADDRESS_SPACE
|
||||
#if IS_ENABLED(CONFIG_LP_IO_ADDRESS_SPACE)
|
||||
if ((inb(IOBASE + 0x05) == 0xFF) &&
|
||||
(inb(IOBASE + 0x06) == 0xFF)) {
|
||||
printf("IO space mapped serial not present.");
|
||||
@@ -118,7 +118,7 @@ void serial_init(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LP_SERIAL_SET_SPEED
|
||||
#if IS_ENABLED(CONFIG_LP_SERIAL_SET_SPEED)
|
||||
serial_hardware_init(CONFIG_LP_SERIAL_BAUD_RATE, 8, 0, 1);
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user