From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 336ACA00C4; Thu, 29 Sep 2022 14:05:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2981440694; Thu, 29 Sep 2022 14:05:10 +0200 (CEST) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mails.dpdk.org (Postfix) with ESMTP id 9217540395 for ; Thu, 29 Sep 2022 14:05:08 +0200 (CEST) Received: by mail-wr1-f49.google.com with SMTP id v28so1861623wrd.3 for ; Thu, 29 Sep 2022 05:05:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=czGnXihUVOpY1PZ/OH/7h2bBi8Pf6NTBwZdcFY+NA9k=; b=FNzQUNwccnh4IvKLY9Jt+QSeZBs9pp1HHqRu7MMTW2Wj2xX/EtLp3qKvQQrgcaiB77 p5bRpkufpWZ2jf2BbETUbeM1S8Xo4/HEgqfwoImhZ6ceZEYKOqH8qpaZx9Km2kH8wYrh PeKRv4k2/kEY89jMT8NKVH/kZW1N/UIFWr0WK39N0IQ/3m+7r9slk3OI8t4WrIeU/Hc5 uZY4zXisU9qM6aWBHZJ6DyFJ6uX7uycnxAAtc5zurqNbJ1TOn+ViYP+P8HoWzcF04Rzw VIMxIqN/V9U2Uu9FXO7yZsdrQgu6otVGneWK6Ou0SyR0If/6WWj1XuQCVwWdyGgGCTkZ DAWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=czGnXihUVOpY1PZ/OH/7h2bBi8Pf6NTBwZdcFY+NA9k=; b=aND1Shl4GtNcHnXHz+ykJevosHd8VNuvfp3XRj8rTjT6U16jMX7wa3nPrKnN45dqU4 OLHt9TleIRRdwv7HrLTm7n8kyLqVUQn44VcNRvNAm2SqI5lW2i2VxGHkf2ZOic66OKdX mBHMLba27iWLYF9XEJy09roUIPGhxZYiw2jn5WhLkpAW3aL6apjY4aek7krpcSUrOwIZ fcw2NqoBLwSrxQrbPRptpxPC9ksEHSSdIMxtmc9bxDg7DeypMR3phb2Xq58SvRbxL0oH rUbc28378CDJdZG0jJDJblTI6XR95vrYzpN7+/ymy7tCbUdzmZmgwTCoZ+I+xaX3TG5m BYjA== X-Gm-Message-State: ACrzQf0xMXQ9GJUNy2rV+BbeYhpTMrTFRfdzVJS3qEh5vL95kJyBl8pV 5cmJbN/CX4A3s7GnURIJ5efME99f8hdhUuwj X-Google-Smtp-Source: AMsMyM55iYKlABl0BbCIUBPjGbj4rok2mzUUjeVNKY8Ua0addbBclVeuC2gqL/d5kiyZGlLJtGBjsw== X-Received: by 2002:adf:d209:0:b0:228:6298:f288 with SMTP id j9-20020adfd209000000b002286298f288mr1976517wrh.386.1664453108348; Thu, 29 Sep 2022 05:05:08 -0700 (PDT) Received: from gojira.dev.6wind.com ([185.13.181.2]) by smtp.gmail.com with ESMTPSA id r9-20020adfda49000000b002258235bda3sm6742648wrl.61.2022.09.29.05.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Sep 2022 05:05:07 -0700 (PDT) From: Olivier Matz To: dev@dpdk.org Cc: Akhil Goyal , Fan Zhang Subject: [PATCH] cryptodev: fix unduly newlines in logs Date: Thu, 29 Sep 2022 14:05:01 +0200 Message-Id: <20220929120501.428-1-olivier.matz@6wind.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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(-) 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; } -- 2.30.2