diff --git a/include/import/eb32tree.h b/include/import/eb32tree.h index 391fbd662..4c7a3a649 100644 --- a/include/import/eb32tree.h +++ b/include/import/eb32tree.h @@ -126,7 +126,7 @@ static forceinline struct eb32_node *__eb32_lookup(struct eb_root *root, u32 x) return NULL; while (1) { - if ((eb_gettag(troot) == EB_LEAF)) { + if (unlikely(eb_gettag(troot) == EB_LEAF)) { node = container_of(eb_untag(troot, EB_LEAF), struct eb32_node, node.branches); if (node->key == x) @@ -180,7 +180,7 @@ static forceinline struct eb32_node *__eb32i_lookup(struct eb_root *root, s32 x) return NULL; while (1) { - if ((eb_gettag(troot) == EB_LEAF)) { + if (unlikely(eb_gettag(troot) == EB_LEAF)) { node = container_of(eb_untag(troot, EB_LEAF), struct eb32_node, node.branches); if (node->key == (u32)x) diff --git a/include/import/eb64tree.h b/include/import/eb64tree.h index baaeb1dfe..7e3a0f0f3 100644 --- a/include/import/eb64tree.h +++ b/include/import/eb64tree.h @@ -126,7 +126,7 @@ static forceinline struct eb64_node *__eb64_lookup(struct eb_root *root, u64 x) return NULL; while (1) { - if ((eb_gettag(troot) == EB_LEAF)) { + if (unlikely(eb_gettag(troot) == EB_LEAF)) { node = container_of(eb_untag(troot, EB_LEAF), struct eb64_node, node.branches); if (node->key == x) @@ -180,7 +180,7 @@ static forceinline struct eb64_node *__eb64i_lookup(struct eb_root *root, s64 x) return NULL; while (1) { - if ((eb_gettag(troot) == EB_LEAF)) { + if (unlikely(eb_gettag(troot) == EB_LEAF)) { node = container_of(eb_untag(troot, EB_LEAF), struct eb64_node, node.branches); if (node->key == (u64)x) diff --git a/src/eb32tree.c b/src/eb32tree.c index 19af56e1a..2e824a734 100644 --- a/src/eb32tree.c +++ b/src/eb32tree.c @@ -57,7 +57,7 @@ struct eb32_node *eb32_lookup_le(struct eb_root *root, u32 x) return NULL; while (1) { - if ((eb_gettag(troot) == EB_LEAF)) { + if (unlikely(eb_gettag(troot) == EB_LEAF)) { /* We reached a leaf, which means that the whole upper * parts were common. We will return either the current * node or its next one if the former is too small. @@ -152,7 +152,7 @@ struct eb32_node *eb32_lookup_ge(struct eb_root *root, u32 x) return NULL; while (1) { - if ((eb_gettag(troot) == EB_LEAF)) { + if (unlikely(eb_gettag(troot) == EB_LEAF)) { /* We reached a leaf, which means that the whole upper * parts were common. We will return either the current * node or its next one if the former is too small. diff --git a/src/eb64tree.c b/src/eb64tree.c index e5f6322bd..c1e183ea6 100644 --- a/src/eb64tree.c +++ b/src/eb64tree.c @@ -57,7 +57,7 @@ struct eb64_node *eb64_lookup_le(struct eb_root *root, u64 x) return NULL; while (1) { - if ((eb_gettag(troot) == EB_LEAF)) { + if (unlikely(eb_gettag(troot) == EB_LEAF)) { /* We reached a leaf, which means that the whole upper * parts were common. We will return either the current * node or its next one if the former is too small. @@ -152,7 +152,7 @@ struct eb64_node *eb64_lookup_ge(struct eb_root *root, u64 x) return NULL; while (1) { - if ((eb_gettag(troot) == EB_LEAF)) { + if (unlikely(eb_gettag(troot) == EB_LEAF)) { /* We reached a leaf, which means that the whole upper * parts were common. We will return either the current * node or its next one if the former is too small.