summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2024-04-01 10:01:53 -0700
committerDavid Marchand <david.marchand@redhat.com>2024-06-14 16:23:45 +0200
commitd399102d786031ad85b74065c1f3a2d6ca8c3d74 (patch)
treef3d49b556d77ef4a7d3811f16e33ed5207bd003e
parente0ddaa4c019542a2ba8c7b548556781c068c12be (diff)
mempool: fix some build issue with MSVC
Applying __rte_unused to a variable has no effect with MS windows compiler. The temporary variable used if debug enabled can just be eliminated. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
-rw-r--r--lib/mempool/rte_mempool.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
index ff67fe4181..d8e39e5c20 100644
--- a/lib/mempool/rte_mempool.c
+++ b/lib/mempool/rte_mempool.c
@@ -164,7 +164,6 @@ mempool_add_elem(struct rte_mempool *mp, __rte_unused void *opaque,
void *obj, rte_iova_t iova)
{
struct rte_mempool_objhdr *hdr;
- struct rte_mempool_objtlr *tlr __rte_unused;
/* set mempool ptr in header */
hdr = RTE_PTR_SUB(obj, sizeof(*hdr));
@@ -175,8 +174,7 @@ mempool_add_elem(struct rte_mempool *mp, __rte_unused void *opaque,
#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
hdr->cookie = RTE_MEMPOOL_HEADER_COOKIE2;
- tlr = rte_mempool_get_trailer(obj);
- tlr->cookie = RTE_MEMPOOL_TRAILER_COOKIE;
+ rte_mempool_get_trailer(obj)->cookie = RTE_MEMPOOL_TRAILER_COOKIE;
#endif
}