cryptodev: fix unduly newlines in logs

Message ID 20220929120501.428-1-olivier.matz@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series cryptodev: fix unduly newlines in logs |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS

Commit Message

Olivier Matz Sept. 29, 2022, 12:05 p.m. UTC
  The CDEV_LOG_* macros already add a '\n' at the end of
the line. Remove it from format strings to avoid duplicated
newlines.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/cryptodev/cryptodev_pmd.c |  4 ++--
 lib/cryptodev/cryptodev_pmd.h |  2 +-
 lib/cryptodev/rte_cryptodev.c | 26 +++++++++++++-------------
 3 files changed, 16 insertions(+), 16 deletions(-)
  

Comments

David Marchand Sept. 30, 2022, 6:42 a.m. UTC | #1
On Thu, Sep 29, 2022 at 2:05 PM Olivier Matz <olivier.matz@6wind.com> wrote:
>
> The CDEV_LOG_* macros already add a '\n' at the end of
> the line. Remove it from format strings to avoid duplicated
> newlines.
>
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>

I had the exact same patch in store :-).
We may want to backport it, but otherwise:
Reviewed-by: David Marchand <david.marchand@redhat.com>
  
Akhil Goyal Sept. 30, 2022, 6:47 p.m. UTC | #2
> On Thu, Sep 29, 2022 at 2:05 PM Olivier Matz <olivier.matz@6wind.com> wrote:
> >
> > The CDEV_LOG_* macros already add a '\n' at the end of
> > the line. Remove it from format strings to avoid duplicated
> > newlines.
> >
> > Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> 
> I had the exact same patch in store :-).
> We may want to backport it, but otherwise:
> Reviewed-by: David Marchand <david.marchand@redhat.com>
> 
Added fixes tags.
Fixes: 725d2a7fbf7 ("cryptodev: add APIs to assist PMD initialisation")
Fixes: e764cd72a9b ("cryptodev: update symmetric session structure")
Fixes: 1d6f89885e1 ("cryptodev: add sym session mempool create")
Fixes: 1f1e4b7cbaa ("cryptodev: use single mempool for asymmetric session")
Fixes: 757f40e28e1 ("cryptodev: modify return value for asym session create")
Fixes: cea66374dcb ("cryptodev: support asymmetric operations")
Cc: stable@dpdk.org

Acked-by: Akhil Goyal <gakhil@marvell.com>

Applied to dpdk-next-crypto

Thanks for fixes Olivier.
  

Patch

diff --git a/lib/cryptodev/cryptodev_pmd.c b/lib/cryptodev/cryptodev_pmd.c
index d90b2570b1..77b269f312 100644
--- a/lib/cryptodev/cryptodev_pmd.c
+++ b/lib/cryptodev/cryptodev_pmd.c
@@ -99,11 +99,11 @@  rte_cryptodev_pmd_create(const char *name,
 	struct rte_cryptodev *cryptodev;
 
 	if (params->name[0] != '\0') {
-		CDEV_LOG_INFO("User specified device name = %s\n", params->name);
+		CDEV_LOG_INFO("User specified device name = %s", params->name);
 		name = params->name;
 	}
 
-	CDEV_LOG_INFO("Creating cryptodev %s\n", name);
+	CDEV_LOG_INFO("Creating cryptodev %s", name);
 
 	CDEV_LOG_INFO("Initialisation parameters - name: %s,"
 			"socket id: %d, max queue pairs: %u",
diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index 96d7e225b0..09ba952455 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -652,7 +652,7 @@  set_sym_session_private_data(struct rte_cryptodev_sym_session *sess,
 		uint8_t driver_id, void *private_data)
 {
 	if (unlikely(sess->nb_drivers <= driver_id)) {
-		CDEV_LOG_ERR("Set private data for driver %u not allowed\n",
+		CDEV_LOG_ERR("Set private data for driver %u not allowed",
 				driver_id);
 		return;
 	}
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 5e25e607fa..05d6aa793f 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -1235,13 +1235,13 @@  rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
 	}
 
 	if (!qp_conf) {
-		CDEV_LOG_ERR("qp_conf cannot be NULL\n");
+		CDEV_LOG_ERR("qp_conf cannot be NULL");
 		return -EINVAL;
 	}
 
 	if ((qp_conf->mp_session && !qp_conf->mp_session_private) ||
 			(!qp_conf->mp_session && qp_conf->mp_session_private)) {
-		CDEV_LOG_ERR("Invalid mempools\n");
+		CDEV_LOG_ERR("Invalid mempools");
 		return -EINVAL;
 	}
 
@@ -1254,7 +1254,7 @@  rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
 		pool_priv = rte_mempool_get_priv(qp_conf->mp_session);
 		if (!pool_priv || qp_conf->mp_session->private_data_size <
 				sizeof(*pool_priv)) {
-			CDEV_LOG_ERR("Invalid mempool\n");
+			CDEV_LOG_ERR("Invalid mempool");
 			return -EINVAL;
 		}
 
@@ -1265,7 +1265,7 @@  rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
 			obj_size) || (s.nb_drivers <= dev->driver_id) ||
 			rte_cryptodev_sym_get_private_session_size(dev_id) >
 				obj_priv_size) {
-			CDEV_LOG_ERR("Invalid mempool\n");
+			CDEV_LOG_ERR("Invalid mempool");
 			return -EINVAL;
 		}
 	}
@@ -1787,7 +1787,7 @@  rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 
 	obj_sz = rte_cryptodev_sym_get_header_session_size() + user_data_size;
 	if (obj_sz > elt_size)
-		CDEV_LOG_INFO("elt_size %u is expanded to %u\n", elt_size,
+		CDEV_LOG_INFO("elt_size %u is expanded to %u", elt_size,
 				obj_sz);
 	else
 		obj_sz = elt_size;
@@ -1797,14 +1797,14 @@  rte_cryptodev_sym_session_pool_create(const char *name, uint32_t nb_elts,
 			NULL, NULL, NULL, NULL,
 			socket_id, 0);
 	if (mp == NULL) {
-		CDEV_LOG_ERR("%s(name=%s) failed, rte_errno=%d\n",
+		CDEV_LOG_ERR("%s(name=%s) failed, rte_errno=%d",
 			__func__, name, rte_errno);
 		return NULL;
 	}
 
 	pool_priv = rte_mempool_get_priv(mp);
 	if (!pool_priv) {
-		CDEV_LOG_ERR("%s(name=%s) failed to get private data\n",
+		CDEV_LOG_ERR("%s(name=%s) failed to get private data",
 			__func__, name);
 		rte_mempool_free(mp);
 		return NULL;
@@ -1835,7 +1835,7 @@  rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts,
 				max_priv_sz = priv_sz;
 		}
 	if (max_priv_sz == 0) {
-		CDEV_LOG_INFO("Could not set max private session size\n");
+		CDEV_LOG_INFO("Could not set max private session size");
 		return NULL;
 	}
 
@@ -1848,14 +1848,14 @@  rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts,
 			NULL, NULL, NULL, NULL,
 			socket_id, 0);
 	if (mp == NULL) {
-		CDEV_LOG_ERR("%s(name=%s) failed, rte_errno=%d\n",
+		CDEV_LOG_ERR("%s(name=%s) failed, rte_errno=%d",
 			__func__, name, rte_errno);
 		return NULL;
 	}
 
 	pool_priv = rte_mempool_get_priv(mp);
 	if (!pool_priv) {
-		CDEV_LOG_ERR("%s(name=%s) failed to get private data\n",
+		CDEV_LOG_ERR("%s(name=%s) failed to get private data",
 			__func__, name);
 		rte_mempool_free(mp);
 		return NULL;
@@ -1902,7 +1902,7 @@  rte_cryptodev_sym_session_create(struct rte_mempool *mp)
 	struct rte_cryptodev_sym_session_pool_private_data *pool_priv;
 
 	if (!rte_cryptodev_sym_is_valid_session_pool(mp)) {
-		CDEV_LOG_ERR("Invalid mempool\n");
+		CDEV_LOG_ERR("Invalid mempool");
 		return NULL;
 	}
 
@@ -1952,7 +1952,7 @@  rte_cryptodev_asym_session_create(uint8_t dev_id,
 		return -EINVAL;
 
 	if (!mp) {
-		CDEV_LOG_ERR("invalid mempool\n");
+		CDEV_LOG_ERR("invalid mempool");
 		return -EINVAL;
 	}
 
@@ -2404,7 +2404,7 @@  rte_crypto_op_pool_create(const char *name, enum rte_crypto_op_type type,
 		elt_size += RTE_MAX(sizeof(struct rte_crypto_sym_op),
 		                    sizeof(struct rte_crypto_asym_op));
 	} else {
-		CDEV_LOG_ERR("Invalid op_type\n");
+		CDEV_LOG_ERR("Invalid op_type");
 		return NULL;
 	}