diff options
author | Patrick Georgi <pgeorgi@google.com> | 2018-05-16 11:31:34 +0200 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-05-17 19:34:48 -0700 |
commit | ae6d7a30c333308a5aebdfc0b7dc012a2a50324a (patch) | |
tree | 8b28cbb9bec8a1da7ec9a7447b2a000f0ae066dd | |
parent | b3311c23b1fdc38daeb5e169d6e48fa62cac251e (diff) | |
download | chrome-ec-ae6d7a30c333308a5aebdfc0b7dc012a2a50324a.tar.gz |
make local functions static inline
They're only used within the same file and should always be inlined.
It also helps gcc 8.1's lto linking which seems to not inline it (since
inline is just a hint) but then drops the function (presumably because
it's small, marked inline, and comes with no prototype).
BUG=b:65441143
BRANCH=none
TEST=builds with gcc 8.1
Change-Id: I881a5b9f13192dd11748d8a3060788f95a84dec0
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1061075
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
-rw-r--r-- | core/cortex-m/task.c | 2 | ||||
-rw-r--r-- | core/cortex-m0/task.c | 2 | ||||
-rw-r--r-- | driver/led/lm3509.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c index bab5310245..b2515e4d3f 100644 --- a/core/cortex-m/task.c +++ b/core/cortex-m/task.c @@ -210,7 +210,7 @@ inline int in_interrupt_context(void) return ret; } -inline int get_interrupt_context(void) +static inline int get_interrupt_context(void) { int ret; asm("mrs %0, ipsr \n":"=r"(ret)); /* read exception number */ diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c index 27465080a6..a137bf7cee 100644 --- a/core/cortex-m0/task.c +++ b/core/cortex-m0/task.c @@ -165,7 +165,7 @@ inline int in_interrupt_context(void) return ret; } -inline int get_interrupt_context(void) +static inline int get_interrupt_context(void) { int ret; asm("mrs %0, ipsr\n" : "=r"(ret)); /* read exception number */ diff --git a/driver/led/lm3509.c b/driver/led/lm3509.c index 11cacc6251..0f44681659 100644 --- a/driver/led/lm3509.c +++ b/driver/led/lm3509.c @@ -10,12 +10,12 @@ #include "keyboard_backlight.h" #include "lm3509.h" -inline int lm3509_write(uint8_t reg, uint8_t val) +static inline int lm3509_write(uint8_t reg, uint8_t val) { return i2c_write8(I2C_PORT_KBLIGHT, LM3509_I2C_ADDR, reg, val); } -inline int lm3509_read(uint8_t reg, int *val) +static inline int lm3509_read(uint8_t reg, int *val) { return i2c_read8(I2C_PORT_KBLIGHT, LM3509_I2C_ADDR, reg, val); } |