[v2,06/13] drivers/mempool: use log register macro
Checks
Commit Message
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: Sachin Saxena <sachin.saxena@oss.nxp.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
---
drivers/mempool/dpaa/dpaa_mempool.c | 10 ++--------
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 10 +---------
drivers/mempool/octeontx/octeontx_fpavf.c | 10 +---------
3 files changed, 4 insertions(+), 26 deletions(-)
@@ -36,7 +36,8 @@ struct dpaa_memseg_list rte_dpaa_memsegs
= TAILQ_HEAD_INITIALIZER(rte_dpaa_memsegs);
struct dpaa_bp_info *rte_dpaa_bpid_info;
-int dpaa_logtype_mempool;
+
+RTE_LOG_REGISTER(dpaa_logtype_mempool, mempool.dpaa, NOTICE);
static int
dpaa_mbuf_create_pool(struct rte_mempool *mp)
@@ -357,10 +358,3 @@ static const struct rte_mempool_ops dpaa_mpool_ops = {
};
MEMPOOL_REGISTER_OPS(dpaa_mpool_ops);
-
-RTE_INIT(dpaa_mp_init_log)
-{
- dpaa_logtype_mempool = rte_log_register("mempool.dpaa");
- if (dpaa_logtype_mempool >= 0)
- rte_log_set_level(dpaa_logtype_mempool, RTE_LOG_NOTICE);
-}
@@ -36,9 +36,6 @@
struct dpaa2_bp_info *rte_dpaa2_bpid_info;
static struct dpaa2_bp_list *h_bp_list;
-/* Dynamic logging identified for mempool */
-int dpaa2_logtype_mempool;
-
static int
rte_hw_mbuf_create_pool(struct rte_mempool *mp)
{
@@ -454,9 +451,4 @@ static const struct rte_mempool_ops dpaa2_mpool_ops = {
MEMPOOL_REGISTER_OPS(dpaa2_mpool_ops);
-RTE_INIT(dpaa2_mempool_init_log)
-{
- dpaa2_logtype_mempool = rte_log_register("mempool.dpaa2");
- if (dpaa2_logtype_mempool >= 0)
- rte_log_set_level(dpaa2_logtype_mempool, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(dpaa2_logtype_mempool, mempool.dpaa2, NOTICE);
@@ -105,15 +105,7 @@ struct octeontx_fpadev {
static struct octeontx_fpadev fpadev;
-int octeontx_logtype_fpavf;
-int octeontx_logtype_fpavf_mbox;
-
-RTE_INIT(otx_pool_init_log)
-{
- octeontx_logtype_fpavf = rte_log_register("pmd.mempool.octeontx");
- if (octeontx_logtype_fpavf >= 0)
- rte_log_set_level(octeontx_logtype_fpavf, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(octeontx_logtype_fpavf, pmd.mempool.octeontx, NOTICE);
/* lock is taken by caller */
static int