From: Michael Jeanson Date: Tue, 30 Mar 2021 19:19:13 +0000 (-0400) Subject: cleanup: function attribute 'unused' X-Git-Tag: v2.13.0-rc1~167 X-Git-Url: https://git.lttng.org/?p=lttng-ust.git;a=commitdiff_plain;h=8da9deee450bf62c6c3abb1f44f9414c0667dd6f cleanup: function attribute 'unused' Function attributes should be located after the declaration. Change-Id: I62e4c3e521705756b99571281937bba6d5a6d063 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index a8ee06be..02d2cf13 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -161,8 +161,9 @@ extern "C" { */ #define _DECLARE_TRACEPOINT(_provider, _name, ...) \ extern struct lttng_ust_tracepoint __tracepoint_##_provider##___##_name; \ -static inline __attribute__((always_inline, unused)) lttng_ust_notrace \ -void __tracepoint_cb_##_provider##___##_name(_TP_ARGS_PROTO(__VA_ARGS__)); \ +static inline \ +void __tracepoint_cb_##_provider##___##_name(_TP_ARGS_PROTO(__VA_ARGS__)) \ + __attribute__((always_inline, unused)) lttng_ust_notrace; \ static \ void __tracepoint_cb_##_provider##___##_name(_TP_ARGS_PROTO(__VA_ARGS__)) \ { \ diff --git a/liblttng-ust-libc-wrapper/lttng-ust-malloc.c b/liblttng-ust-libc-wrapper/lttng-ust-malloc.c index 54b40e6a..e4f9c356 100644 --- a/liblttng-ust-libc-wrapper/lttng-ust-malloc.c +++ b/liblttng-ust-libc-wrapper/lttng-ust-malloc.c @@ -56,7 +56,10 @@ void *static_calloc(size_t nmemb, size_t size); */ static int ust_malloc_lock; -static __attribute__((unused)) +static +void ust_malloc_spin_lock(pthread_mutex_t *lock) + __attribute__((unused)); +static void ust_malloc_spin_lock(pthread_mutex_t *lock) { /* @@ -68,7 +71,10 @@ void ust_malloc_spin_lock(pthread_mutex_t *lock) caa_cpu_relax(); } -static __attribute__((unused)) +static +void ust_malloc_spin_unlock(pthread_mutex_t *lock) + __attribute__((unused)); +static void ust_malloc_spin_unlock(pthread_mutex_t *lock) { /* diff --git a/liblttng-ust/lttng-hash-helper.h b/liblttng-ust/lttng-hash-helper.h index 1978fbde..36c3ae42 100644 --- a/liblttng-ust/lttng-hash-helper.h +++ b/liblttng-ust/lttng-hash-helper.h @@ -43,7 +43,10 @@ do { \ c ^= b; c -= rot(b, 24); \ } -static inline __attribute__((unused)) +static inline +uint32_t lttng_hash_u32(const uint32_t *k, size_t length, uint32_t initval) + __attribute__((unused)); +static inline uint32_t lttng_hash_u32( const uint32_t *k, /* the key, an array of uint32_t values */ size_t length, /* the length of the key, in uint32_ts */ diff --git a/liblttng-ust/rculfhash.c b/liblttng-ust/rculfhash.c index b25c1c18..efdb5e70 100644 --- a/liblttng-ust/rculfhash.c +++ b/liblttng-ust/rculfhash.c @@ -439,7 +439,10 @@ unsigned int fls_u64(uint64_t x) #endif #ifndef HAS_FLS_U64 -static __attribute__((unused)) +static +unsigned int fls_u64(uint64_t x) + __attribute__((unused)); +static unsigned int fls_u64(uint64_t x) { unsigned int r = 64; @@ -476,7 +479,10 @@ unsigned int fls_u64(uint64_t x) #endif #ifndef HAS_FLS_U32 -static __attribute__((unused)) +static +unsigned int fls_u32(uint32_t x) + __attribute__((unused)); +static unsigned int fls_u32(uint32_t x) { unsigned int r = 32;