fix: Revert "Makefile: Enable -Wimplicit-fallthrough for Clang" (v5.15)
[lttng-modules.git] / src / lib / counter / counter.c
index bd5c459f7b26f315e4f00eaae1f34c4a4757b3eb..bf038aacd3b54f55bd6ad6a58b9325e24074600d 100644 (file)
@@ -11,7 +11,9 @@
 #include <linux/cpumask.h>
 #include <counter/counter.h>
 #include <counter/counter-internal.h>
+#include <wrapper/compiler_attributes.h>
 #include <wrapper/vmalloc.h>
+#include <wrapper/limits.h>
 
 static size_t lttng_counter_get_dimension_nr_elements(struct lib_counter_dimension *dimension)
 {
@@ -323,7 +325,8 @@ int lttng_counter_aggregate(const struct lib_counter_config *config,
        *underflow = false;
 
        switch (config->alloc) {
-       case COUNTER_ALLOC_GLOBAL:      /* Fallthrough */
+       case COUNTER_ALLOC_GLOBAL:
+               lttng_fallthrough;
        case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
                /* Read global counter. */
                ret = lttng_counter_read(config, counter, dimension_indexes,
@@ -341,7 +344,8 @@ int lttng_counter_aggregate(const struct lib_counter_config *config,
        switch (config->alloc) {
        case COUNTER_ALLOC_GLOBAL:
                break;
-       case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:      /* Fallthrough */
+       case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
+               lttng_fallthrough;
        case COUNTER_ALLOC_PER_CPU:
                //TODO: integrate with CPU hotplug and online cpus
                for (cpu = 0; cpu < num_possible_cpus(); cpu++) {
@@ -447,7 +451,8 @@ int lttng_counter_clear(const struct lib_counter_config *config,
        int cpu, ret;
 
        switch (config->alloc) {
-       case COUNTER_ALLOC_GLOBAL:      /* Fallthrough */
+       case COUNTER_ALLOC_GLOBAL:
+               lttng_fallthrough;
        case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
                /* Clear global counter. */
                ret = lttng_counter_clear_cpu(config, counter, dimension_indexes, -1);
@@ -461,7 +466,8 @@ int lttng_counter_clear(const struct lib_counter_config *config,
        switch (config->alloc) {
        case COUNTER_ALLOC_GLOBAL:
                break;
-       case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:      /* Fallthrough */
+       case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
+               lttng_fallthrough;
        case COUNTER_ALLOC_PER_CPU:
                //TODO: integrate with CPU hotplug and online cpus
                for (cpu = 0; cpu < num_possible_cpus(); cpu++) {
This page took 0.024509 seconds and 4 git commands to generate.