From: Ondřej Surý Date: Sat, 17 Mar 2018 19:43:16 +0000 (+0000) Subject: Remove extra incrementcounter / decrementcounter functions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef368be4d153ca7f1cedcb8dacf4fa7205f5df86;p=thirdparty%2Fbind9.git Remove extra incrementcounter / decrementcounter functions --- diff --git a/lib/isc/stats.c b/lib/isc/stats.c index 4f89e0c0f8a..8c4fd62e83e 100644 --- a/lib/isc/stats.c +++ b/lib/isc/stats.c @@ -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