cleanup: Move #include directives

Move all #include directives at the very top of the file, before any
code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2017-08-31 11:02:47 -04:00 committed by Anas Nashif
commit 8920cf127a
4 changed files with 4 additions and 17 deletions

View file

@ -24,6 +24,7 @@
#include <linker/sections.h>
#include <sw_isr_table.h>
#include <irq.h>
#include <misc/printk.h>
/*
* @brief Enable an interrupt line
@ -95,7 +96,6 @@ void _irq_priority_set(unsigned int irq, unsigned int prio, u32_t flags)
* @return N/A
*/
#include <misc/printk.h>
void _irq_spurious(void *unused)
{
ARG_UNUSED(unused);

View file

@ -11,7 +11,8 @@
#include <errno.h>
#include <kernel.h>
#include <device.h>
#include <init.h>
#include <misc/util.h>
#include <gpio.h>
#include <i2c.h>
@ -554,9 +555,6 @@ static int gpio_pcal9535a_init(struct device *dev)
/* Initialization for PCAL9535A_0 */
#ifdef CONFIG_GPIO_PCAL9535A_0
#include <device.h>
#include <init.h>
static const struct gpio_pcal9535a_config gpio_pcal9535a_0_cfg = {
.i2c_master_dev_name = CONFIG_GPIO_PCAL9535A_0_I2C_MASTER_DEV_NAME,
.i2c_slave_addr = CONFIG_GPIO_PCAL9535A_0_I2C_ADDR,
@ -581,9 +579,6 @@ DEVICE_INIT(gpio_pcal9535a_0, CONFIG_GPIO_PCAL9535A_0_DEV_NAME,
/* Initialization for PCAL9535A_1 */
#ifdef CONFIG_GPIO_PCAL9535A_1
#include <device.h>
#include <init.h>
static const struct gpio_pcal9535a_config gpio_pcal9535a_1_cfg = {
.i2c_master_dev_name = CONFIG_GPIO_PCAL9535A_1_I2C_MASTER_DEV_NAME,
.i2c_slave_addr = CONFIG_GPIO_PCAL9535A_1_I2C_ADDR,
@ -608,9 +603,6 @@ DEVICE_INIT(gpio_pcal9535a_1, CONFIG_GPIO_PCAL9535A_1_DEV_NAME,
/* Initialization for PCAL9535A_2 */
#ifdef CONFIG_GPIO_PCAL9535A_2
#include <device.h>
#include <init.h>
static const struct gpio_pcal9535a_config gpio_pcal9535a_2_cfg = {
.i2c_master_dev_name = CONFIG_GPIO_PCAL9535A_2_I2C_MASTER_DEV_NAME,
.i2c_slave_addr = CONFIG_GPIO_PCAL9535A_2_I2C_ADDR,
@ -635,9 +627,6 @@ DEVICE_INIT(gpio_pcal9535a_2, CONFIG_GPIO_PCAL9535A_2_DEV_NAME,
/* Initialization for PCAL9535A_3 */
#ifdef CONFIG_GPIO_PCAL9535A_3
#include <device.h>
#include <init.h>
static const struct gpio_pcal9535a_config gpio_pcal9535a_3_cfg = {
.i2c_master_dev_name = CONFIG_GPIO_PCAL9535A_3_I2C_MASTER_DEV_NAME,
.i2c_slave_addr = CONFIG_GPIO_PCAL9535A_3_I2C_ADDR,

View file

@ -26,6 +26,7 @@
#include <ksched.h>
#include <version.h>
#include <string.h>
#include <misc/dlist.h>
/* kernel build timestamp items */
@ -111,7 +112,6 @@ k_tid_t const _idle_thread = (k_tid_t)&_idle_thread_s;
K_THREAD_STACK_DEFINE(_interrupt_stack, CONFIG_ISR_STACK_SIZE);
#ifdef CONFIG_SYS_CLOCK_EXISTS
#include <misc/dlist.h>
#define initialize_timeouts() do { \
sys_dlist_init(&_timeout_q); \
} while ((0))

View file

@ -203,8 +203,6 @@ u32_t k_uptime_delta_32(s64_t *reftime)
/* handle the expired timeouts in the nano timeout queue */
#ifdef CONFIG_SYS_CLOCK_EXISTS
#include <wait_q.h>
/*
* Handle timeouts by dequeuing the expired ones from _timeout_q and queue
* them on a local one, then doing the real handling from that queue. This