From patchwork Tue Feb 27 23:07:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 137402 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9034343C06; Wed, 28 Feb 2024 00:08:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 540E740EF1; Wed, 28 Feb 2024 00:07:58 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 46A39402AC for ; Wed, 28 Feb 2024 00:07:55 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 8029420B74C2; Tue, 27 Feb 2024 15:07:54 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8029420B74C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1709075274; bh=0jysnPQpU/7AXxEEhzqIqeE3qfr4Ck1++9wN/ZTslTc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N8ipo/prT6SIfjT5ZJ5vv273rrBgavYWxpjwG00IWvfPEYs5io0EgVmw3IEuXxPN1 jjrrheivy4uOiXxzFk39a6SglIfKsiNkpKl5p/tt9IjxQSdoh6ct6AJFzNc/COZIsj oiPUSRORKYtzTmWWT/3/6ONAhi2YUXn99HOqa4Ag= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , Honnappa Nagarahalli , Vladimir Medvedkin , Tyler Retzlaff Subject: [PATCH 2/3] lpm: use rte macro instead of GCC attribute Date: Tue, 27 Feb 2024 15:07:52 -0800 Message-Id: <1709075273-6885-3-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709075273-6885-1-git-send-email-roretzla@linux.microsoft.com> References: <1709075273-6885-1-git-send-email-roretzla@linux.microsoft.com> 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 Use newly added __rte_pure macro from rte_common.h instead of directly using __attribute__((pure)). Signed-off-by: Tyler Retzlaff --- lib/lpm/rte_lpm.c | 4 ++-- lib/lpm/rte_lpm6.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/lpm/rte_lpm.c b/lib/lpm/rte_lpm.c index 9633d63..a5c9e7c 100644 --- a/lib/lpm/rte_lpm.c +++ b/lib/lpm/rte_lpm.c @@ -85,7 +85,7 @@ struct __rte_lpm { * depth (IN) : range = 1 - 32 * mask (OUT) : 32bit mask */ -static uint32_t __attribute__((pure)) +static uint32_t __rte_pure depth_to_mask(uint8_t depth) { VERIFY_DEPTH(depth); @@ -99,7 +99,7 @@ static uint32_t __attribute__((pure)) /* * Converts given depth value to its corresponding range value. */ -static uint32_t __attribute__((pure)) +static uint32_t __rte_pure depth_to_range(uint8_t depth) { VERIFY_DEPTH(depth); diff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c index 271bc48..2bdd540 100644 --- a/lib/lpm/rte_lpm6.c +++ b/lib/lpm/rte_lpm6.c @@ -1127,7 +1127,7 @@ struct rte_lpm6 * * Convert a depth to a one byte long mask * Example: 4 will be converted to 0xF0 */ -static uint8_t __attribute__((pure)) +static uint8_t __rte_pure depth_to_mask_1b(uint8_t depth) { /* To calculate a mask start with a 1 on the left hand side and right