[v3,13/13] app/test: use log register macro
diff mbox series

Message ID 20200701064828.4097247-14-jerinj@marvell.com
State Superseded
Delegated to: Thomas Monjalon
Headers show
Series
  • rte_log registration usage improvement
Related show

Checks

Context Check Description
ci/Intel-compilation fail apply issues
ci/travis-robot warning Travis build: failed
ci/checkpatch success coding style OK

Commit Message

Jerin Jacob Kollanukkaran July 1, 2020, 6:48 a.m. UTC
From: Jerin Jacob <jerinj@marvell.com>

Use log register macro to avoid the code duplication
in the log registration process.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
---
 app/test/test_efd.c            | 6 +-----
 app/test/test_hash.c           | 7 +------
 app/test/test_timer_racecond.c | 7 +------
 3 files changed, 3 insertions(+), 17 deletions(-)

Patch
diff mbox series

diff --git a/app/test/test_efd.c b/app/test/test_efd.c
index e3e5e30ea..3d9aa8a57 100644
--- a/app/test/test_efd.c
+++ b/app/test/test_efd.c
@@ -32,12 +32,8 @@  struct flow_key {
 	uint8_t proto;
 } __rte_packed;
 
-int efd_logtype_test;
 
-RTE_INIT(test_efd_init_log)
-{
-	efd_logtype_test = rte_log_register("test.efd");
-}
+RTE_LOG_REGISTER(efd_logtype_test, test.efd, INFO);
 
 /*
  * Print out result of unit test efd operation.
diff --git a/app/test/test_hash.c b/app/test/test_hash.c
index afa3a1a3c..990a1815f 100644
--- a/app/test/test_hash.c
+++ b/app/test/test_hash.c
@@ -69,8 +69,6 @@  struct flow_key {
 	uint8_t proto;
 } __rte_packed;
 
-int hash_logtype_test;
-
 /*
  * Hash function that always returns the same value, to easily test what
  * happens when a bucket is full.
@@ -82,10 +80,7 @@  static uint32_t pseudo_hash(__rte_unused const void *keys,
 	return 3;
 }
 
-RTE_INIT(test_hash_init_log)
-{
-	hash_logtype_test = rte_log_register("test.hash");
-}
+RTE_LOG_REGISTER(hash_logtype_test, test.hash, INFO);
 
 /*
  * Print out result of unit test hash operation.
diff --git a/app/test/test_timer_racecond.c b/app/test/test_timer_racecond.c
index 4fc917995..28af9ca76 100644
--- a/app/test/test_timer_racecond.c
+++ b/app/test/test_timer_racecond.c
@@ -61,12 +61,7 @@  static volatile unsigned stop_slaves;
 
 static int reload_timer(struct rte_timer *tim);
 
-int timer_logtype_test;
-
-RTE_INIT(test_timer_init_log)
-{
-	timer_logtype_test = rte_log_register("test.timer");
-}
+RTE_LOG_REGISTER(timer_logtype_test, test.timer, INFO);
 
 static void
 timer_cb(struct rte_timer *tim, void *arg __rte_unused)