aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>2018-06-14 14:46:04 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-06-18 15:08:56 +0200
commit3d3dd3c0912441ced1a31962248594a0d961ec46 (patch)
tree650d8b9be06033f8344f877fb0234e602b04c5b3
parentselftest/mpmc_ring: Remove const qualifier from mpmc_ptr_ring_produce argument (diff)
downloadwireguard-monolithic-historical-3d3dd3c0912441ced1a31962248594a0d961ec46.tar.xz
wireguard-monolithic-historical-3d3dd3c0912441ced1a31962248594a0d961ec46.zip
selftest/mpmc_ring: Add more __init/__initdata annotations
The main function, mpmc_ring_selftest, is already marked with __init, but the callback functions and the ring pointer were not.
-rw-r--r--src/selftest/mpmc_ring.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/selftest/mpmc_ring.h b/src/selftest/mpmc_ring.h
index 41ea9f9..251456f 100644
--- a/src/selftest/mpmc_ring.h
+++ b/src/selftest/mpmc_ring.h
@@ -20,7 +20,7 @@
#define PER_CONSUMER (ELEMENT_COUNT/THREADS_CONSUMER)
#define THREADS_TOTAL (THREADS_PRODUCER + THREADS_CONSUMER)
-struct mpmc_ptr_ring *ring;
+struct mpmc_ptr_ring *ring __initdata;
struct worker_producer {
struct work_struct work;
@@ -34,7 +34,7 @@ struct worker_consumer {
long count;
};
-static void producer_function(struct work_struct *work)
+static __init void producer_function(struct work_struct *work)
{
struct worker_producer *td = container_of(work, struct worker_producer, work);
uintptr_t count = (td->thread_num * PER_PRODUCER) + 1;
@@ -45,7 +45,7 @@ static void producer_function(struct work_struct *work)
}
}
-static void consumer_function(struct work_struct *work)
+static __init void consumer_function(struct work_struct *work)
{
struct worker_consumer *td = container_of(work, struct worker_consumer, work);
int i;