]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove extra incrementcounter / decrementcounter functions
authorOndřej Surý <ondrej@sury.org>
Sat, 17 Mar 2018 19:43:16 +0000 (19:43 +0000)
committerOndřej Surý <ondrej@sury.org>
Thu, 24 May 2018 08:36:23 +0000 (10:36 +0200)
lib/isc/stats.c

index 4f89e0c0f8a3d1ee955b060f609e7da80793bc94..8c4fd62e83e00228526b89e9a6f6462621dafe50 100644 (file)
@@ -155,18 +155,6 @@ isc_stats_ncounters(isc_stats_t *stats) {
        return (stats->ncounters);
 }
 
-static inline void
-incrementcounter(isc_stats_t *stats, int counter) {
-       atomic_fetch_add_explicit(&stats->counters[counter], 1,
-                                 memory_order_relaxed);
-}
-
-static inline void
-decrementcounter(isc_stats_t *stats, int counter) {
-       atomic_fetch_sub_explicit(&stats->counters[counter], 1,
-                                 memory_order_relaxed);
-}
-
 static void
 copy_counters(isc_stats_t *stats) {
        int i;
@@ -190,7 +178,8 @@ isc_stats_increment(isc_stats_t *stats, isc_statscounter_t counter) {
        REQUIRE(ISC_STATS_VALID(stats));
        REQUIRE(counter < stats->ncounters);
 
-       incrementcounter(stats, (int)counter);
+       atomic_fetch_add_explicit(&stats->counters[counter], 1,
+                                 memory_order_relaxed);
 }
 
 void
@@ -198,7 +187,8 @@ isc_stats_decrement(isc_stats_t *stats, isc_statscounter_t counter) {
        REQUIRE(ISC_STATS_VALID(stats));
        REQUIRE(counter < stats->ncounters);
 
-       decrementcounter(stats, (int)counter);
+       atomic_fetch_sub_explicit(&stats->counters[counter], 1,
+                                 memory_order_relaxed);
 }
 
 void