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 <axel.lin@ingics.com>
This commit is contained in:
Axel Lin 2015-11-17 10:08:37 +08:00 committed by goldsimon
parent 21b9b5e741
commit 9c6708513a

View File

@ -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;
}