From bf5db9fac89c52d9c75ea17ae86c54565fdcafd6 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Wed, 10 Aug 2016 11:18:34 -0600 Subject: npcx/i2c: Remove static from arrays & functions used by inline function This fixes several errors caused by these being defined as static while being used in the inline function i2c_handle_sda_irq(). From the C99 Draft 6.7.4.3: An inline definition of a function with external linkage shall not contain a definition of a modifiable object with static storage duration, and shall not contain a reference to an identifier with internal linkage. TEST=Build with GCC 5.3 flash and boot Reef board BUG=None BRANCH=None Change-Id: Ie487f17b92736c2a56280783267da5d3bb12b969 Signed-off-by: Martin Roth Reviewed-on: https://chromium-review.googlesource.com/367486 Reviewed-by: Randall Spangler --- chip/npcx/i2c.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chip/npcx/i2c.c b/chip/npcx/i2c.c index 6b01b1f88a..eedefce008 100644 --- a/chip/npcx/i2c.c +++ b/chip/npcx/i2c.c @@ -79,7 +79,7 @@ enum smb_oper_state_t { }; /* IRQ for each port */ -static const uint32_t i2c_irqs[I2C_CONTROLLER_COUNT] = { +const uint32_t i2c_irqs[I2C_CONTROLLER_COUNT] = { NPCX_IRQ_SMB1, NPCX_IRQ_SMB2, NPCX_IRQ_SMB3, NPCX_IRQ_SMB4}; BUILD_ASSERT(ARRAY_SIZE(i2c_irqs) == I2C_CONTROLLER_COUNT); @@ -98,7 +98,7 @@ struct i2c_status { uint32_t timeout_us;/* Transaction timeout */ }; /* I2C controller state data array */ -static struct i2c_status i2c_stsobjs[I2C_CONTROLLER_COUNT]; +struct i2c_status i2c_stsobjs[I2C_CONTROLLER_COUNT]; /* I2C timing setting */ struct i2c_timing { @@ -335,7 +335,7 @@ enum smb_error i2c_master_transaction(int controller) } /* Issue stop condition if necessary and end transaction */ -static void i2c_done(int controller) +void i2c_done(int controller) { volatile struct i2c_status *p_status = i2c_stsobjs + controller; -- cgit v1.2.1