diff mbox series

[v3,2/3] linux-generic: pool: avoid direct use of printf() in check_params

Message ID 1513026020-24993-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v3,1/3] linux-generic: pool: validate params before creating pool | expand

Commit Message

Github ODP bot Dec. 11, 2017, 9 p.m. UTC
From: Bill Fischofer <bill.fischofer@linaro.org>


Use ODP_DBG() for diagnostic error prints rather than direct use
of printf(). This allows errors to be output conditionally and via
the log function.

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

---
/** Email created from pull request 325 (Bill-Fischofer-Linaro:bug3465)
 ** https://github.com/Linaro/odp/pull/325
 ** Patch: https://github.com/Linaro/odp/pull/325.patch
 ** Base sha: 6881620135a179911a5839d4be97423a8d80e5ab
 ** Merge commit sha: 031d1e139f0c3b25b906fc9c79120fd327a758c4
 **/
 platform/linux-generic/odp_pool.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c
index b3c652360..d0e4674f9 100644
--- a/platform/linux-generic/odp_pool.c
+++ b/platform/linux-generic/odp_pool.c
@@ -534,17 +534,17 @@  static int check_params(odp_pool_param_t *params)
 	switch (params->type) {
 	case ODP_POOL_BUFFER:
 		if (params->buf.num > capa.buf.max_num) {
-			printf("buf.num too large %u\n", params->buf.num);
+			ODP_DBG("buf.num too large %u\n", params->buf.num);
 			return -1;
 		}
 
 		if (params->buf.size > capa.buf.max_size) {
-			printf("buf.size too large %u\n", params->buf.size);
+			ODP_DBG("buf.size too large %u\n", params->buf.size);
 			return -1;
 		}
 
 		if (params->buf.align > capa.buf.max_align) {
-			printf("buf.align too large %u\n", params->buf.align);
+			ODP_DBG("buf.align too large %u\n", params->buf.align);
 			return -1;
 		}
 
@@ -552,25 +552,25 @@  static int check_params(odp_pool_param_t *params)
 
 	case ODP_POOL_PACKET:
 		if (params->pkt.len > capa.pkt.max_len) {
-			printf("pkt.len too large %u\n", params->pkt.len);
+			ODP_DBG("pkt.len too large %u\n", params->pkt.len);
 			return -1;
 		}
 
 		if (params->pkt.max_len > capa.pkt.max_len) {
-			printf("pkt.max_len too large %u\n",
-			       params->pkt.max_len);
+			ODP_DBG("pkt.max_len too large %u\n",
+				params->pkt.max_len);
 			return -1;
 		}
 
 		if (params->pkt.seg_len > capa.pkt.max_seg_len) {
-			printf("pkt.seg_len too large %u\n",
-			       params->pkt.seg_len);
+			ODP_DBG("pkt.seg_len too large %u\n",
+				params->pkt.seg_len);
 			return -1;
 		}
 
 		if (params->pkt.uarea_size > capa.pkt.max_uarea_size) {
-			printf("pkt.uarea_size too large %u\n",
-			       params->pkt.uarea_size);
+			ODP_DBG("pkt.uarea_size too large %u\n",
+				params->pkt.uarea_size);
 			return -1;
 		}
 
@@ -578,13 +578,13 @@  static int check_params(odp_pool_param_t *params)
 
 	case ODP_POOL_TIMEOUT:
 		if (params->tmo.num > capa.tmo.max_num) {
-			printf("tmo.num too large %u\n", params->tmo.num);
+			ODP_DBG("tmo.num too large %u\n", params->tmo.num);
 			return -1;
 		}
 		break;
 
 	default:
-		printf("bad pool type %i\n", params->type);
+		ODP_DBG("bad pool type %i\n", params->type);
 		return -1;
 	}