[2/4] eal: simplify check condition
Checks
Commit Message
The alt_elem is initialized to null. Checking only size hint flag is
sufficient to return a proper value.
Removed the redundant check.
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
---
lib/eal/common/malloc_heap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 5/19/2023 5:29 AM, Ruifeng Wang wrote:
> The alt_elem is initialized to null. Checking only size hint flag is
> sufficient to return a proper value.
> Removed the redundant check.
>
> Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
@@ -168,7 +168,7 @@ find_suitable_element(struct malloc_heap *heap, size_t size,
}
}
- if ((alt_elem != NULL) && (flags & RTE_MEMZONE_SIZE_HINT_ONLY))
+ if (flags & RTE_MEMZONE_SIZE_HINT_ONLY)
return alt_elem;
return NULL;