Do not check for DO_CONSOLE_INIT, use Kconfig variables instead

This commit removes 2 levels of checking and checks directly against
define Kconfig variables. Also reduce the code to one block and check
only once instead of twice.

This is a cosmetic change.

Change-Id: Ia427d9f15a9d09ea59d0230913168060d752ae99
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2015-07-06 11:26:31 -04:00
parent 098e9dc68f
commit db404bbdf9
4 changed files with 6 additions and 34 deletions

View File

@ -46,9 +46,6 @@ for the fsl_frdm_k64f BSP.
#include <drivers/k6x_pmc.h>
#include <sections.h>
#if defined(CONFIG_PRINTK) || defined(CONFIG_STDOUT_CONSOLE)
#define DO_CONSOLE_INIT
#endif
/* board's setting for PLL multipler (PRDIV0) */
#define FRDM_K64F_PLL_DIV_20 (20 - 1)
@ -245,8 +242,7 @@ static void clkInit(void)
;
}
#if defined(DO_CONSOLE_INIT)
#if defined(CONFIG_PRINTK) || defined(CONFIG_STDOUT_CONSOLE)
/**
*
* @brief Initialize target-only console
@ -296,7 +292,7 @@ static void consoleInit(void)
#define consoleInit() \
do {/* nothing */ \
} while ((0))
#endif /* DO_CONSOLE_INIT */
#endif /* defined(CONFIG_PRINTK) || defined(CONFIG_STDOUT_CONSOLE) */
/**
*

View File

@ -40,9 +40,6 @@ for the ti_lm3s6965 BSP.
#include <board.h>
#include <drivers/uart.h>
#if defined(CONFIG_PRINTK) || defined(CONFIG_STDOUT_CONSOLE)
#define DO_CONSOLE_INIT
#endif
#define RCGC1 *((volatile uint32_t *)0x400FE104)
@ -57,7 +54,7 @@ extern void _NmiInit(void);
#define NMI_INIT()
#endif
#if defined(DO_CONSOLE_INIT)
#if defined(CONFIG_PRINTK) || defined(CONFIG_STDOUT_CONSOLE)
/**
*
@ -75,10 +72,6 @@ inline void uart_generic_info_init(struct uart_init_info *pInfo)
pInfo->int_pri = CONFIG_UART_CONSOLE_INT_PRI;
}
#endif /* DO_CONSOLE_INIT */
#if defined(DO_CONSOLE_INIT)
/**
*
* @brief Initialize target-only console
@ -109,7 +102,7 @@ static void consoleInit(void)
#define consoleInit() \
do {/* nothing */ \
} while ((0))
#endif /* DO_CONSOLE_INIT */
#endif /* defined(CONFIG_PRINTK) || defined(CONFIG_STDOUT_CONSOLE) */
#if defined(CONFIG_BLUETOOTH)
#if defined(CONFIG_BLUETOOTH_UART)

View File

@ -80,11 +80,6 @@ static inline void ioapicInit(void)
#endif /* CONFIG_IOAPIC */
#if defined(CONFIG_PRINTK) || defined(CONFIG_STDOUT_CONSOLE)
#define DO_CONSOLE_INIT
#endif
#ifdef DO_CONSOLE_INIT
/**
*
@ -102,9 +97,6 @@ void uart_generic_info_init(struct uart_init_info *p_info)
p_info->int_pri = CONFIG_UART_CONSOLE_INT_PRI;
}
#endif /* DO_CONSOLE_INIT */
#if defined(DO_CONSOLE_INIT)
/**
*
@ -131,7 +123,7 @@ static void consoleInit(void)
#define consoleInit() \
do {/* nothing */ \
} while ((0))
#endif /* DO_CONSOLE_INIT */
#endif /* defined(CONFIG_PRINTK) || defined(CONFIG_STDOUT_CONSOLE) */
#if defined(CONFIG_BLUETOOTH)
#if defined(CONFIG_BLUETOOTH_UART)

View File

@ -50,11 +50,6 @@ Handlers for the secondary serial port have not been added.
#include <drivers/pci/pci_mgr.h>
#if defined(CONFIG_PRINTK) || defined(CONFIG_STDOUT_CONSOLE)
#define DO_CONSOLE_INIT
#endif
#if defined(DO_CONSOLE_INIT)
/**
*
* @brief Initialize initialization information for one UART
@ -70,10 +65,6 @@ void uart_generic_info_init(struct uart_init_info *p_info)
p_info->baud_rate = CONFIG_UART_BAUDRATE;
}
#endif /* DO_CONSOLE_INIT */
#if defined(DO_CONSOLE_INIT)
/**
*
* @brief Initialize target-only console
@ -99,7 +90,7 @@ static void consoleInit(void)
#define consoleInit() \
do {/* nothing */ \
} while ((0))
#endif /* DO_CONSOLE_INIT */
#endif /* defined(CONFIG_PRINTK) || defined(CONFIG_STDOUT_CONSOLE) */
/**
*