[v3,4/5] app/test: use rte macro instead of GCC attribute

Message ID 1709763287-10713-5-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series use rte macros instead of GCC __attribute |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff March 6, 2024, 10:14 p.m. UTC
  Use newly added __rte_pure macro from rte_common.h instead of
directly using __attribute__((pure)).

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 app/test-fib/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Morten Brørup March 6, 2024, 10:41 p.m. UTC | #1
> From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com]
> Sent: Wednesday, 6 March 2024 23.15
> 
> Use newly added __rte_pure macro from rte_common.h instead of
> directly using __attribute__((pure)).
> 
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> ---

Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
  

Patch

diff --git a/app/test-fib/main.c b/app/test-fib/main.c
index 75a5613..c49bfe8 100644
--- a/app/test-fib/main.c
+++ b/app/test-fib/main.c
@@ -137,13 +137,13 @@  struct rt_rule_6 {
 		return (rte_rand() % (u - l) + l);
 }
 
-static __rte_always_inline __attribute__((pure)) uint8_t
+static __rte_always_inline __rte_pure uint8_t
 bits_in_nh(uint8_t nh_sz)
 {
 	return 8 * (1 << nh_sz);
 }
 
-static  __rte_always_inline __attribute__((pure)) uint64_t
+static  __rte_always_inline __rte_pure uint64_t
 get_max_nh(uint8_t nh_sz)
 {
 	/* min between fib and lpm6 which is 21 bits */