From ef368be4d153ca7f1cedcb8dacf4fa7205f5df86 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Sat, 17 Mar 2018 19:43:16 +0000 Subject: [PATCH] Remove extra incrementcounter / decrementcounter functions --- lib/isc/stats.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) 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 -- 2.47.3