cryptodev: fix unduly newlines in logs
PATCH 1/1 cryptodev: fix unduly newlines in logs
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 <[email protected]>
--- 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(-)
lib/cryptodev/cryptodev_pmd.c +2 -2
@@ -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",
lib/cryptodev/cryptodev_pmd.h +1 -1
@@ -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 ; }
lib/cryptodev/rte_cryptodev.c +13 -13
@@ -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 ; }
Signature · 1 line
2.30.2
Quoted 6 lines · Olivier Matz
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 <[email protected]>
I had the exact same patch in store :-).
We may want to backport it, but otherwise:
Reviewed-by David Marchand <[email protected]>
Signature · 1 line
David Marchand
Quoted 6 lines · Olivier Matz
Quoted 5 lines
The CDEV_LOG_* macros already add a '\n' at the end of the line. Remove it from format strings to avoid duplicated newlines.
Quoted 6 lines
Quoted 1 line
Signed-off-by Olivier Matz <[email protected]>I had the exact same patch in store :-).
We may want to backport it, but otherwise:Reviewed-by David Marchand <[email protected]>
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")
Acked-by Akhil Goyal <[email protected]>
Applied to dpdk-next-crypto
Thanks for fixes Olivier.