From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH 2/2] mempool: fix unused warning with MSVC
Date: Mon, 1 Apr 2024 10:01:53 -0700 [thread overview]
Message-ID: <20240401170257.121047-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20240401170257.121047-1-stephen@networkplumber.org>
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>
---
lib/mempool/rte_mempool.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
index 734e8a2feb..2ac815a3bb 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
}
--
2.43.0
next prev parent reply other threads:[~2024-04-01 17:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-01 17:01 [PATCH 0/2] mempool: patches Stephen Hemminger
2024-04-01 17:01 ` [PATCH 1/2] mempool: replace GCC pragma with cast Stephen Hemminger
2024-04-01 17:21 ` Tyler Retzlaff
2024-04-01 17:01 ` Stephen Hemminger [this message]
2024-04-01 17:22 ` [PATCH 2/2] mempool: fix unused warning with MSVC Tyler Retzlaff
2024-06-14 14:25 ` [PATCH 0/2] mempool: patches David Marchand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240401170257.121047-3-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).