DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH v2 3/3] pdump: cleanup checkpatch warnings
Date: Tue, 29 Dec 2020 12:09:01 -0800	[thread overview]
Message-ID: <20201229200901.101171-4-stephen@networkplumber.org> (raw)
In-Reply-To: <20201229200901.101171-1-stephen@networkplumber.org>

Checkpatch prefers 'unsigned int' over bare 'unsigned'.
Reword the error messages for brevity and clarity
so they don't have to be split across multiple lines.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_pdump/rte_pdump.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c
index 14a392ef0340..d20e944e0454 100644
--- a/lib/librte_pdump/rte_pdump.c
+++ b/lib/librte_pdump/rte_pdump.c
@@ -71,7 +71,7 @@ tx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
 static inline void
 pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
 {
-	unsigned i;
+	unsigned int i;
 	int ring_enq;
 	uint16_t d_pkts = 0;
 	struct rte_mbuf *dup_bufs[nb_pkts];
@@ -131,8 +131,7 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 		if (cbs && operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
-					"failed to add rx callback for port=%d "
-					"and queue=%d, callback already exists\n",
+					"rx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
@@ -152,8 +151,7 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 
 			if (cbs->cb == NULL) {
 				PDUMP_LOG(ERR,
-					"failed to delete non existing rx "
-					"callback for port=%d and queue=%d\n",
+					"no existing rx callback for port=%d queue=%d\n",
 					port, qid);
 				return -EINVAL;
 			}
@@ -186,8 +184,7 @@ pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 		if (cbs && operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
-					"failed to add tx callback for port=%d "
-					"and queue=%d, callback already exists\n",
+					"tx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
@@ -207,8 +204,7 @@ pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 
 			if (cbs->cb == NULL) {
 				PDUMP_LOG(ERR,
-					"failed to delete non existing tx "
-					"callback for port=%d and queue=%d\n",
+					"no existing tx callback for port=%d queue=%d\n",
 					port, qid);
 				return -EINVAL;
 			}
@@ -351,7 +347,9 @@ pdump_server(const struct rte_mp_msg *mp_msg, const void *peer)
 int
 rte_pdump_init(void)
 {
-	int ret = rte_mp_action_register(PDUMP_MP, pdump_server);
+	int ret;
+
+	ret = rte_mp_action_register(PDUMP_MP, pdump_server);
 	if (ret && rte_errno != ENOTSUP)
 		return -1;
 	return 0;
@@ -374,14 +372,16 @@ pdump_validate_ring_mp(struct rte_ring *ring, struct rte_mempool *mp)
 		return -1;
 	}
 	if (mp->flags & MEMPOOL_F_SP_PUT || mp->flags & MEMPOOL_F_SC_GET) {
-		PDUMP_LOG(ERR, "mempool with either SP or SC settings"
-		" is not valid for pdump, should have MP and MC settings\n");
+		PDUMP_LOG(ERR,
+			  "mempool with SP or SC set not valid for pdump,"
+			  "must have MP and MC set\n");
 		rte_errno = EINVAL;
 		return -1;
 	}
 	if (rte_ring_is_prod_single(ring) || rte_ring_is_cons_single(ring)) {
-		PDUMP_LOG(ERR, "ring with either SP or SC settings"
-		" is not valid for pdump, should have MP and MC settings\n");
+		PDUMP_LOG(ERR,
+			  "ring with SP or SC set is not valid for pdump,"
+			  "must have MP and MC set\n");
 		rte_errno = EINVAL;
 		return -1;
 	}
-- 
2.29.2


  parent reply	other threads:[~2020-12-29 20:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-27  3:33 [dpdk-dev] [PATCH 0/2] pdump: small enhancements Stephen Hemminger
2020-12-27  3:33 ` [dpdk-dev] [PATCH 1/2] pdump: use rte_pktmbuf_free bulk Stephen Hemminger
2020-12-29  5:40   ` Morten Brørup
2020-12-27  3:33 ` [dpdk-dev] [PATCH 2/2] pdump: replace DEVICE_ID_SIZE with RTE_DEV_NAME_MAX_LEN Stephen Hemminger
2020-12-29 20:08 ` [dpdk-dev] [PATCH v2 0/3] pdump: small enhancements Stephen Hemminger
2020-12-29 20:08   ` [dpdk-dev] [PATCH v2 1/3] pdump: use rte_pktmbuf_free bulk Stephen Hemminger
2020-12-29 20:09   ` [dpdk-dev] [PATCH v2 2/3] pdump: replace DEVICE_ID_SIZE with RTE_DEV_NAME_MAX_LEN Stephen Hemminger
2020-12-29 20:09   ` Stephen Hemminger [this message]
2021-01-19 14:25   ` [dpdk-dev] [PATCH v2 0/3] pdump: small enhancements Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201229200901.101171-4-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).