summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2018-05-16 11:31:34 +0200
committerCommit Bot <commit-bot@chromium.org>2021-04-20 14:25:25 +0000
commit6f18f739f21a2a34e4ba8b70d99c0f5e066b49f5 (patch)
treefbf164b25a38cdc21e25b089b3ef78c36f4f5f80
parent6f815b3b6c2423ecdb05cb912602df7550a42a00 (diff)
downloadchrome-ec-6f18f739f21a2a34e4ba8b70d99c0f5e066b49f5.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> (cherry picked from commit ae6d7a30c333308a5aebdfc0b7dc012a2a50324a) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2723458 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--core/cortex-m/task.c2
-rw-r--r--core/cortex-m0/task.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c
index 6b978c9d33..4ba4bee112 100644
--- a/core/cortex-m/task.c
+++ b/core/cortex-m/task.c
@@ -199,7 +199,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 7fb27a747e..019c7e005f 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 */