From c589eca21586907ffd057fa614e7e2715086b5c7 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Tue, 30 Mar 2021 15:35:19 -0400 Subject: [PATCH] cleanup: function attribute 'destructor' Function attributes should be located after the declaration. Change-Id: Iad766f5861a6b2de0d9dd3a0f87909ed7f8dc092 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- include/lttng/tracepoint.h | 10 ++++++---- include/lttng/ust-tracepoint-event.h | 5 +++-- liblttng-ust-ctl/ustctl.c | 5 ++++- liblttng-ust/lttng-ust-comm.c | 6 +++++- liblttng-ust/lttng-ust-urcu.c | 3 ++- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index d4733e05..927b1a3c 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -369,8 +369,9 @@ __tracepoints__init(void) __tracepoint__init_urcu_sym(); } -static void lttng_ust_notrace __attribute__((destructor)) -__tracepoints__destroy(void); +static void +__tracepoints__destroy(void) + lttng_ust_notrace __attribute__((destructor)); static void __tracepoints__destroy(void) { @@ -501,8 +502,9 @@ __tracepoints__ptrs_init(void) } } -static void lttng_ust_notrace __attribute__((destructor)) -__tracepoints__ptrs_destroy(void); +static void +__tracepoints__ptrs_destroy(void) + lttng_ust_notrace __attribute__((destructor)); static void __tracepoints__ptrs_destroy(void) { diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index f4d3d285..cf770759 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -1089,8 +1089,9 @@ _TP_COMBINE_TOKENS(__lttng_events_init__, TRACEPOINT_PROVIDER)(void) } } -static void lttng_ust_notrace __attribute__((destructor)) -_TP_COMBINE_TOKENS(__lttng_events_exit__, TRACEPOINT_PROVIDER)(void); +static void +_TP_COMBINE_TOKENS(__lttng_events_exit__, TRACEPOINT_PROVIDER)(void) + lttng_ust_notrace __attribute__((destructor)); static void _TP_COMBINE_TOKENS(__lttng_events_exit__, TRACEPOINT_PROVIDER)(void) { diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index ecfed8c7..e1c9ac7d 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -2914,7 +2914,10 @@ void ustctl_init(void) lib_ringbuffer_signal_init(); } -static __attribute__((destructor)) +static +void ustctl_exit(void) + __attribute__((destructor)); +static void ustctl_exit(void) { lttng_ust_counter_clients_exit(); diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index 69ccd99d..748417ab 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -2279,7 +2279,11 @@ void lttng_ust_cleanup(int exiting) } } -void __attribute__((destructor)) lttng_ust_exit(void) +static +void lttng_ust_exit(void) + __attribute__((destructor)); +static +void lttng_ust_exit(void) { int ret; diff --git a/liblttng-ust/lttng-ust-urcu.c b/liblttng-ust/lttng-ust-urcu.c index 4381fd1c..4629067f 100644 --- a/liblttng-ust/lttng-ust-urcu.c +++ b/liblttng-ust/lttng-ust-urcu.c @@ -96,7 +96,8 @@ static void _lttng_ust_urcu_init(void) __attribute__((constructor)); static -void __attribute__((destructor)) lttng_ust_urcu_exit(void); +void lttng_ust_urcu_exit(void) + __attribute__((destructor)); #ifndef CONFIG_RCU_FORCE_SYS_MEMBARRIER int lttng_ust_urcu_has_sys_membarrier; -- 2.34.1