Skip to content

Commit

Permalink
eal: fix C++ include
Browse files Browse the repository at this point in the history
[ upstream commit 59144f6 ]

C++ files could not include some headers because:

* "new" is a keyword in C++, so can't be a variable name
* there is no automatic casting to/from void *

Fixes: 184104f ("ticketlock: introduce fair ticket based locking")
Fixes: 032a7e5 ("trace: implement provider payload")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
  • Loading branch information
bruce-richardson authored and kevintraynor committed Feb 21, 2022
1 parent 72334ce commit 1fdfd87
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions lib/eal/include/generic/rte_ticketlock.h
Expand Up @@ -91,13 +91,13 @@ rte_ticketlock_unlock(rte_ticketlock_t *tl)
static inline int
rte_ticketlock_trylock(rte_ticketlock_t *tl)
{
rte_ticketlock_t old, new;
old.tickets = __atomic_load_n(&tl->tickets, __ATOMIC_RELAXED);
new.tickets = old.tickets;
new.s.next++;
if (old.s.next == old.s.current) {
if (__atomic_compare_exchange_n(&tl->tickets, &old.tickets,
new.tickets, 0, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
rte_ticketlock_t oldl, newl;
oldl.tickets = __atomic_load_n(&tl->tickets, __ATOMIC_RELAXED);
newl.tickets = oldl.tickets;
newl.s.next++;
if (oldl.s.next == oldl.s.current) {
if (__atomic_compare_exchange_n(&tl->tickets, &oldl.tickets,
newl.tickets, 0, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/eal/include/rte_trace_point.h
Expand Up @@ -370,7 +370,7 @@ do { \
do { \
if (unlikely(in == NULL)) \
return; \
rte_strscpy(mem, in, __RTE_TRACE_EMIT_STRING_LEN_MAX); \
rte_strscpy((char *)mem, in, __RTE_TRACE_EMIT_STRING_LEN_MAX); \
mem = RTE_PTR_ADD(mem, __RTE_TRACE_EMIT_STRING_LEN_MAX); \
} while (0)

Expand Down

0 comments on commit 1fdfd87

Please sign in to comment.