From 03e355d49b1561b10f3aaf092680e33dba3874e6 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Mon, 30 Oct 2023 10:20:45 +0000 Subject: [PATCH] linux-gen: dma: utilize _odp_pri() Utilize `_odp_pri()` to get rid of repetitive `(uint64_t)(uintptr_t)` casts. Signed-off-by: Tuomas Taipale --- platform/linux-generic/odp_dma.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/linux-generic/odp_dma.c b/platform/linux-generic/odp_dma.c index 279e545bca7..7a8ca391bfd 100644 --- a/platform/linux-generic/odp_dma.c +++ b/platform/linux-generic/odp_dma.c @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -756,12 +757,12 @@ odp_pool_t odp_dma_pool_create(const char *name, const odp_dma_pool_param_t *dma uint64_t odp_dma_to_u64(odp_dma_t dma) { - return (uint64_t)(uintptr_t)dma; + return _odp_pri(dma); } uint64_t odp_dma_compl_to_u64(odp_dma_compl_t dma_compl) { - return (uint64_t)(uintptr_t)dma_compl; + return _odp_pri(dma_compl); } void odp_dma_print(odp_dma_t dma) @@ -794,12 +795,11 @@ void odp_dma_compl_print(odp_dma_compl_t dma_compl) _ODP_PRINT("\nDMA completion\n"); _ODP_PRINT("--------------\n"); - _ODP_PRINT(" Compl event handle: 0x%" PRIx64 "\n", (uint64_t)(uintptr_t)dma_compl); + _ODP_PRINT(" Compl event handle: 0x%" PRIx64 "\n", _odp_pri(dma_compl)); if (ret == 0) { _ODP_PRINT(" Result: %s\n", result.success ? "success" : "fail"); - _ODP_PRINT(" User pointer: 0x%" PRIx64 "\n", - (uint64_t)(uintptr_t)result.user_ptr); + _ODP_PRINT(" User pointer: 0x%" PRIx64 "\n", _odp_pri(result.user_ptr)); } else { _ODP_PRINT(" No result metadata\n"); }