aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/timing_wheel.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-12-13 21:47:40 +0100
committerDave Barach <openvpp@barachs.net>2020-12-14 12:14:21 +0000
commitb2c31b685fd2cf28436ca32bc93e23eb24c74878 (patch)
treedc0a1b1ff784445b2cbb0f9b2c07b5bcb4f5a5d0 /src/vppinfra/timing_wheel.c
parent62c25abaa3e93be5815172d391295a6ab0390122 (diff)
misc: move to new pool_foreach macros
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/timing_wheel.c')
-rw-r--r--src/vppinfra/timing_wheel.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/vppinfra/timing_wheel.c b/src/vppinfra/timing_wheel.c
index bbf3012ffd8..a6c476b2cfa 100644
--- a/src/vppinfra/timing_wheel.c
+++ b/src/vppinfra/timing_wheel.c
@@ -314,10 +314,10 @@ timing_wheel_insert (timing_wheel_t * w, u64 insert_cpu_time, u32 user_data)
{
timing_wheel_overflow_elt_t *oe;
/* *INDENT-OFF* */
- pool_foreach (oe, w->overflow_pool, ({
+ pool_foreach (oe, w->overflow_pool) {
if (oe->user_data == user_data)
pool_put (w->overflow_pool, oe);
- }));
+ }
/* *INDENT-ON* */
}
@@ -398,8 +398,8 @@ timing_wheel_next_expiring_elt_time (timing_wheel_t * w)
min_t = w->cpu_time_base + min_dt;
/* *INDENT-OFF* */
- pool_foreach (oe, w->overflow_pool,
- ({ min_t = clib_min (min_t, oe->cpu_time); }));
+ pool_foreach (oe, w->overflow_pool)
+ { min_t = clib_min (min_t, oe->cpu_time); }
/* *INDENT-ON* */
done:
@@ -503,7 +503,7 @@ advance_cpu_time_base (timing_wheel_t * w, u32 * expired_user_data)
{
timing_wheel_overflow_elt_t *oe;
/* *INDENT-OFF* */
- pool_foreach (oe, w->overflow_pool, ({
+ pool_foreach (oe, w->overflow_pool) {
/* It fits now into 32 bits. */
if (0 == ((oe->cpu_time - w->cpu_time_base) >> BITS (e->cpu_time_relative_to_base)))
{
@@ -520,7 +520,7 @@ advance_cpu_time_base (timing_wheel_t * w, u32 * expired_user_data)
timing_wheel_insert_helper (w, oe->cpu_time, oe->user_data);
pool_put (w->overflow_pool, oe);
}
- }));
+ }
/* *INDENT-ON* */
}
return expired_user_data;