From: Michael Jeanson Date: Fri, 16 Apr 2021 21:09:27 +0000 (-0400) Subject: Fix warnings on non-x86_64 systems X-Git-Tag: v2.13.0-rc1~86 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c494c0f1f1fdc7447354afbecbde2b88c5ff662c;p=lttng-ust.git Fix warnings on non-x86_64 systems Change-Id: I1043786d066576c91ef5a62bf45e890e870c4454 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/src/common/counter/shm.c b/src/common/counter/shm.c index e421d045..8b65d1fc 100644 --- a/src/common/counter/shm.c +++ b/src/common/counter/shm.c @@ -192,11 +192,19 @@ static bool lttng_is_numa_available(void) } #endif +#ifdef HAVE_LIBNUMA struct lttng_counter_shm_object *lttng_counter_shm_object_table_alloc(struct lttng_counter_shm_object_table *table, size_t memory_map_size, enum lttng_counter_shm_object_type type, int cpu_fd, int cpu) +#else +struct lttng_counter_shm_object *lttng_counter_shm_object_table_alloc(struct lttng_counter_shm_object_table *table, + size_t memory_map_size, + enum lttng_counter_shm_object_type type, + int cpu_fd, + int cpu __attribute__((unused))) +#endif { struct lttng_counter_shm_object *shm_object; #ifdef HAVE_LIBNUMA diff --git a/src/common/hash.h b/src/common/hash.h index c3ffc18d..5002915e 100644 --- a/src/common/hash.h +++ b/src/common/hash.h @@ -69,8 +69,8 @@ uint32_t lttng_hash_u32( /*----------------------------------- handle the last 3 uint32_t's */ switch (length) { /* all the case statements fall through */ - case 3: c += k[2]; - case 2: b += k[1]; + case 3: c += k[2]; /* fall through */ + case 2: b += k[1]; /* fall through */ case 1: a += k[0]; final(a, b, c); case 0: /* case 0: nothing left to add */ diff --git a/src/common/ringbuffer/shm.c b/src/common/ringbuffer/shm.c index 8be7e359..a3235b69 100644 --- a/src/common/ringbuffer/shm.c +++ b/src/common/ringbuffer/shm.c @@ -264,11 +264,19 @@ static bool lttng_is_numa_available(void) } #endif +#ifdef HAVE_LIBNUMA struct shm_object *shm_object_table_alloc(struct shm_object_table *table, size_t memory_map_size, enum shm_object_type type, int stream_fd, int cpu) +#else +struct shm_object *shm_object_table_alloc(struct shm_object_table *table, + size_t memory_map_size, + enum shm_object_type type, + int stream_fd, + int cpu __attribute__((unused))) +#endif { struct shm_object *shm_object; #ifdef HAVE_LIBNUMA diff --git a/src/lib/lttng-ust/lttng-context-perf-counters.c b/src/lib/lttng-ust/lttng-context-perf-counters.c index e6833ecd..328980c4 100644 --- a/src/lib/lttng-ust/lttng-context-perf-counters.c +++ b/src/lib/lttng-ust/lttng-context-perf-counters.c @@ -262,7 +262,7 @@ uint64_t arch_read_perf_counter( } static -int arch_perf_keep_fd(struct lttng_perf_counter_thread_field *thread_field) +int arch_perf_keep_fd(struct lttng_perf_counter_thread_field *thread_field __attribute__((unused))) { return 1; } diff --git a/src/lib/lttng-ust/rculfhash.c b/src/lib/lttng-ust/rculfhash.c index de90d710..a03f4421 100644 --- a/src/lib/lttng-ust/rculfhash.c +++ b/src/lib/lttng-ust/rculfhash.c @@ -1006,7 +1006,7 @@ const struct lttng_ust_lfht_mm_type *get_mm_type(unsigned long max_nr_buckets) * For 32-bit architectures, use the order allocator. */ static -const struct lttng_ust_lfht_mm_type *get_mm_type(unsigned long max_nr_buckets) +const struct lttng_ust_lfht_mm_type *get_mm_type(unsigned long max_nr_buckets __attribute__((unused))) { return <tng_ust_lfht_mm_order; }