From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 874A8A0350; Fri, 4 Feb 2022 18:42:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D82640143; Fri, 4 Feb 2022 18:42:30 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id DE22140041 for ; Fri, 4 Feb 2022 18:42:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643996548; x=1675532548; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wxXoraHC/PYMOgAHtbEi1hhTgG70FYfiXZ9yxOydCIQ=; b=laTZCqpRMJ9lmvttJYhHxYVcC2ZOHEQONqM+/ulKarutEtKh6OghEzAW M2S+0uD67U0NOAFwLRSla3yQgB591F2QIntMwM4gVdjfZ9mV3PbzCKCkv hobXYVmWeUCwFWXy3Vd52AkGrIHnyx3zVipxG2bjOTWue18y5dhFo0XSe 3QRJeplEi+azgoHD/p5xjPcm2Xr8VetxXMaT+P4iHxbC3ZzHsSHdNIptR BF1lXfarsq/dOwlRbA2k4btlrdlGL3c0A+xqKxTEYn0mF4hkPA6z+5pKQ aAu28fExBImvklF3+LF2KIKPaK078duIXzgdOTVnvGCtM35KWLrgNqOkv w==; X-IronPort-AV: E=McAfee;i="6200,9189,10248"; a="247241572" X-IronPort-AV: E=Sophos;i="5.88,343,1635231600"; d="scan'208";a="247241572" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2022 09:42:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,343,1635231600"; d="scan'208";a="620890260" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by FMSMGA003.fm.intel.com with ESMTP; 04 Feb 2022 09:42:25 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Joyce Kong , Jerin Jacob , Sunil Kumar Kori Subject: [PATCH 1/7] eal: fix header build with C++ Date: Fri, 4 Feb 2022 17:42:03 +0000 Message-Id: <20220204174209.440207-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220204174209.440207-1-bruce.richardson@intel.com> References: <20220204174209.440207-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 * Signed-off-by: Bruce Richardson --- lib/eal/include/generic/rte_ticketlock.h | 14 +++++++------- lib/eal/include/rte_trace_point.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/eal/include/generic/rte_ticketlock.h b/lib/eal/include/generic/rte_ticketlock.h index c1b8808f51..693c67b517 100644 --- a/lib/eal/include/generic/rte_ticketlock.h +++ b/lib/eal/include/generic/rte_ticketlock.h @@ -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; } diff --git a/lib/eal/include/rte_trace_point.h b/lib/eal/include/rte_trace_point.h index e226f073f7..0f8700974f 100644 --- a/lib/eal/include/rte_trace_point.h +++ b/lib/eal/include/rte_trace_point.h @@ -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) -- 2.32.0