From 70ebeda7ed99695def6a6acaebf87d10d75c21a1 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 15 Jan 2016 18:30:21 +0800 Subject: [PATCH] memp: Simplify implementation of memp_overflow_check_all We don't really care the order of overflow/underflow checking because if any checking fails we got assertion. Signed-off-by: Axel Lin --- src/core/memp.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/core/memp.c b/src/core/memp.c index 31bce1e7..03e3538d 100644 --- a/src/core/memp.c +++ b/src/core/memp.c @@ -167,13 +167,6 @@ memp_overflow_check_all(void) p = (struct memp *)(size_t)(memp_pools[i]->base); for (j = 0; j < memp_pools[i]->num; ++j) { memp_overflow_check_element_overflow(p, memp_pools[i]); - p = (struct memp*)(size_t)((u8_t*)p + MEMP_SIZE + memp_pools[i]->size + MEMP_SANITY_REGION_AFTER_ALIGNED); - } - } - - for (i = 0; i < MEMP_MAX; ++i) { - p = (struct memp *)(size_t)(memp_pools[i]->base); - for (j = 0; j < memp_pools[i]->num; ++j) { memp_overflow_check_element_underflow(p, memp_pools[i]); p = (struct memp*)(size_t)((u8_t*)p + MEMP_SIZE + memp_pools[i]->size + MEMP_SANITY_REGION_AFTER_ALIGNED); }