From 9c6708513a015930e2a9e3e4639156b6cda65e13 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 17 Nov 2015 10:08:37 +0800 Subject: [PATCH] Drop unnecessary NULL test for h->next->next in memp_sanity The h will point to NULL if h->next->next is NULL anyway. So remove the unnecessary NULL test for h->next->next in each iteration. Signed-off-by: Axel Lin --- src/core/memp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/memp.c b/src/core/memp.c index a70dffad..0b62f7f2 100644 --- a/src/core/memp.c +++ b/src/core/memp.c @@ -91,7 +91,7 @@ memp_sanity(const struct memp_desc *desc) t = *desc->tab; if (t != NULL) { for (h = t->next; (t != NULL) && (h != NULL); t = t->next, - h = (((h->next != NULL) && (h->next->next != NULL)) ? h->next->next : NULL)) { + h = ((h->next != NULL) ? h->next->next : NULL)) { if (t == h) { return 0; }