From e65315fb373602082b9289020ccc17f0c4b79935 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Mon, 22 Aug 2016 21:42:57 +0200 Subject: core/counter: add osmo_counter_dec() Change-Id: I030140a45afa295c3ebc4d3ccaffd437b984f515 --- include/osmocom/core/statistics.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/osmocom/core') diff --git a/include/osmocom/core/statistics.h b/include/osmocom/core/statistics.h index 1e472ffd..41716ccf 100644 --- a/include/osmocom/core/statistics.h +++ b/include/osmocom/core/statistics.h @@ -12,6 +12,12 @@ struct osmo_counter { unsigned long previous; /*!< \brief previous value */ }; +/*! \brief Decrement counter */ +static inline void osmo_counter_dec(struct osmo_counter *ctr) +{ + ctr->value--; +} + /*! \brief Increment counter */ static inline void osmo_counter_inc(struct osmo_counter *ctr) { -- cgit v1.2.3