From 5a030ce4aed271344087bca723903e10fef59ac9 Mon Sep 17 00:00:00 2001 From: Okash Khawaja Date: Fri, 8 Apr 2022 18:06:31 +0100 Subject: [PATCH] fix(bakery_lock): add __unused for clang is_lock_acquired() function is only used in assert() statements, so when compiling without asserts, e.g. with DEBUG=0, the function is unused. this is okay when compiling with gcc because the function is marked as inline but that doesn't work for clang. let's mark this as __unused to avoid -Wunused-function warning-as-error. Change-Id: I93f808fd15f715a65d1bd4f7592affb7997c4bad Signed-off-by: Okash Khawaja --- lib/locks/bakery/bakery_lock_normal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/locks/bakery/bakery_lock_normal.c b/lib/locks/bakery/bakery_lock_normal.c index 7d35dea66..faea6c53d 100644 --- a/lib/locks/bakery/bakery_lock_normal.c +++ b/lib/locks/bakery/bakery_lock_normal.c @@ -83,7 +83,7 @@ static inline void read_cache_op(uintptr_t addr, bool cached) } /* Helper function to check if the lock is acquired */ -static inline bool is_lock_acquired(const bakery_info_t *my_bakery_info, +static inline __unused bool is_lock_acquired(const bakery_info_t *my_bakery_info, bool is_cached) { /*