From patchwork Mon Dec 11 21:00:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 121462 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3278068qgn; Mon, 11 Dec 2017 13:01:02 -0800 (PST) X-Google-Smtp-Source: ACJfBosWl8t0gXGUtDzeUGj9HahGeBrzVakY9Lf/IIVXqNjyRE3mqekzEnViDLLhTDEIrHvCLCHP X-Received: by 10.55.17.140 with SMTP id 12mr2421916qkr.229.1513026062066; Mon, 11 Dec 2017 13:01:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513026062; cv=none; d=google.com; s=arc-20160816; b=lUrycBDzJxTBI4wgZz0uiaUwfu3lSPWTPlST0tCGVGHleHK95kAEilFIHBRBixdWs2 dpqJhGoVv51kv6lkx2i4x3QqRN/49P1kfHvFYGyX4NYP7DJgucqO1abnvpfNhwdf1TNz Den8Tq02pxtw6AG2ZCbBLdrxXtpotR+ua6FPX2Rjy4g+iL9tVqTxpg08/nOMbNtGfC3o FwuUd1uQmGPt0GMNuGvD9phQBBzQtUXnFoPdzH6zPuhIxlSNnoHCpT52MINFqqXvNdT0 3Mm73w2cwp+zMU1Cfe8T5iOQfJvppWqRNTzJCwRnWV//Tgxj1bs0PDSQg8hCWuFKoRGZ tkuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=Owl4/2zxDD0wXjxRpNnBmra81aIjOAKI5ken043YfbM=; b=PGi1X6qW125htpGh3n4eSAST/4ibAunJj3mhOWO3dcmgQqInHu3O4GAPTmjS+2Mifk XZhsRGlf7e7q5zP/qayAPF1MBOomGwGD3VtTZ9scqz9lodEv73O0+rVFZGBzM9Vjbhlf 2kfQVBiPbMXlwfZS1yiIJz0c3cPby88GQYPQA11LqY2aRIzBVWr0v7W7dsOzmHbyk5WK Lm6H+DNDJSKTw1xphxmvita9u0PXIje6V2qWy3B624z61HpNvXWTK1gWMKH4PJYqmhep flj5vCMuK52+Saaugv3Z6eoY0eVYfdmueEgP0kpob6lrojTpmwAUhCTrRrSwmSn445gb kFFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id c43si989126qtd.17.2017.12.11.13.01.01; Mon, 11 Dec 2017 13:01:02 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id B0960608E8; Mon, 11 Dec 2017 21:01:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id B6E4360953; Mon, 11 Dec 2017 21:00:29 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 29491608CE; Mon, 11 Dec 2017 21:00:25 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id D4C0D608CE for ; Mon, 11 Dec 2017 21:00:23 +0000 (UTC) Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 3C5A85D84031 for ; Tue, 12 Dec 2017 00:00:22 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback19j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id csN1ympRTk-0M1aBfsb; Tue, 12 Dec 2017 00:00:22 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id YE9KORLQTE-0LbmikBe; Tue, 12 Dec 2017 00:00:21 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 12 Dec 2017 00:00:18 +0300 Message-Id: <1513026020-24993-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513026020-24993-1-git-send-email-odpbot@yandex.ru> References: <1513026020-24993-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 325 Subject: [lng-odp] [PATCH v3 1/3] linux-generic: pool: validate params before creating pool X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Bill Fischofer Enhance the check_params() routine to verify that params != NULL prior to dereferencing it. This fixes Bug https://bugs.linaro.org/show_bug.cgi?id=3465 Signed-off-by: Bill Fischofer --- /** 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 | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index c0dd41ebf..b3c652360 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -352,11 +352,6 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params, const char *postfix = "_uarea"; char uarea_name[ODP_POOL_NAME_LEN + sizeof(postfix)]; - if (params == NULL) { - ODP_ERR("No params"); - return ODP_POOL_INVALID; - } - align = 0; if (params->type == ODP_POOL_BUFFER) @@ -533,7 +528,7 @@ static int check_params(odp_pool_param_t *params) { odp_pool_capability_t capa; - if (odp_pool_capability(&capa) < 0) + if (!params || odp_pool_capability(&capa) < 0) return -1; switch (params->type) { @@ -603,7 +598,7 @@ odp_pool_t odp_pool_create(const char *name, odp_pool_param_t *params) if (check_params(params)) return ODP_POOL_INVALID; - if (params && (params->type == ODP_POOL_PACKET)) + if (params->type == ODP_POOL_PACKET) shm_flags = ODP_SHM_PROC; return pool_create(name, params, shm_flags); From patchwork Mon Dec 11 21:00:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 121463 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3278839qgn; Mon, 11 Dec 2017 13:01:31 -0800 (PST) X-Google-Smtp-Source: ACJfBov37lyEq+XPuqOndv0BwMW/q8O/tOJ3hfwG7bEiDBrcC+NmxqVlrXqSsw0rgzh55DDjzOkA X-Received: by 10.200.26.108 with SMTP id q41mr2643261qtk.7.1513026091803; Mon, 11 Dec 2017 13:01:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513026091; cv=none; d=google.com; s=arc-20160816; b=Is86GB0YexwA0J686ohvSgmbVdJxeAVf6WRDjBP0hz+IOh2ESYO9GqXW59UVg37dL8 2F4wW/LCU9OGkvzZHZANrE+1DceYCjY2kLFZeE3uR3Xmje6pakC3uRFVEQwnIe5rEDS7 6U6Nn1c8rF1mF9lNNI1ZojVxBU4vQ5+gs5QOHZBg3f2ZGBYpupV/75AiMAwYd7z7RrbQ +Kk0RJ0f85YRiGFcwyCdoKYJTNhVoNE+bKC/m+MAquTinLz7GXigl4kVInuf41nbYb6Y 4OTUIZuFZo8OvqzzeW2vmVakHvYpaD2hBDBrdW2PW4Y4tm5nYeYrLnTC/+ZDdBUIZZvB 7GrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=Z92HObaWd47YYNOdVt26wQZFjKujBAyQtRHSAKFwSV0=; b=baC/f1kYiRHHc0YP9cESsbw+risUJdMtNXcY2ppP8acFTT71HEtWjNM3JS9aFSNlPE 9zYsfPYyNcTuWczssBwTVjhUo78DdMoTPYAJwsGfjNiU9wpAXfNAu1u6yNn4DBns7cB3 XbObyBQyPwQE17ZGGl67dQbjB5tOWfjp7uvhUr+CgSfI7nnRA7A8D/iiEH4vuQxKuz68 EihbPbbLOuEXUlJ7HFguzTdAGw2YySffchJMrYLWNI2gQ37VFekx/Y1AB2KspeaA+pWp GDRoiJ9MtW0AuhUjWAEiQWUtbUTC8ra3G/EBTQasGkWZgnllY+GKACeYgnqDrAfKQPzg tPmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id a9si1408880qtg.455.2017.12.11.13.01.31; Mon, 11 Dec 2017 13:01:31 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 43F6B6097B; Mon, 11 Dec 2017 21:01:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 0D8F96097D; Mon, 11 Dec 2017 21:00:33 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 8768F608E8; Mon, 11 Dec 2017 21:00:26 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id 689F1608E6 for ; Mon, 11 Dec 2017 21:00:24 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward105p.mail.yandex.net (Yandex) with ESMTP id DE9704083BC6 for ; Tue, 12 Dec 2017 00:00:22 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 15eXwxvZVA-0M0eKx5t; Tue, 12 Dec 2017 00:00:22 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id YE9KORLQTE-0MbiuWV7; Tue, 12 Dec 2017 00:00:22 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 12 Dec 2017 00:00:19 +0300 Message-Id: <1513026020-24993-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513026020-24993-1-git-send-email-odpbot@yandex.ru> References: <1513026020-24993-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 325 Subject: [lng-odp] [PATCH v3 2/3] linux-generic: pool: avoid direct use of printf() in check_params X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Bill Fischofer 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 --- /** 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 --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; } From patchwork Mon Dec 11 21:00:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 121464 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3279592qgn; Mon, 11 Dec 2017 13:02:02 -0800 (PST) X-Google-Smtp-Source: ACJfBosGZx2z//odTVYwIvFLn9fzNBShBIV0qNfhXp/aA9wzWF5+8DnGrn0qFgXN23k4ATsK20B1 X-Received: by 10.55.23.68 with SMTP id i65mr2387577qkh.179.1513026122437; Mon, 11 Dec 2017 13:02:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513026122; cv=none; d=google.com; s=arc-20160816; b=ENdiu6VmQ9I8oVgkgYni4jcQAxAS87GGegOZ3PNg6/qbkkY3t+hWFb8cEMwxYIvJE0 H/NJjbjxLxpyBELN6iCarbh4uIFwqQhjI5SYq2M/idCTTLDiE/eP6ssA9RLAqDvoRKra Fo7MmLrUWQulx4H5pZB6IlM3nD+z+9o+tR5205vNZzRDNpUMd+/FqlzS+mkUpo2049zj 4LirYUPcKE8UX33eHvpPHwTBt0ZHJf6/MoZu0SwyYKou2hFjIw/Mmx2RXNEt1oKYKVnI B3/zDcYXGOLgZjKKLuE62tz7x2GtBODKnfoO45Us7f8jOGsSF3uPc/eAPtBuCEkVdXHT va9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=m25+FpN69cRj8+xE5fvZ5Xj9kceUZa0UZwuXjyy0sGc=; b=qPE75anFQGS2pK+3r88fDH9+KjoyG9XQLzuSM9Lwr1kDsoeZK5NyOuDJKKnB5n+vXJ dglXdWaPIoEf2I/3NMOBvrqkRcDsRhG3aWwiW3jeDaVFCLb4kN5qFUv76B7+DQD9IHIo htlOGEf3DqmZ3kZvmJnmR1mVk7bThbr24Q8Urxua9pVl6UUMAL4mrbifwinIOR/1RbYK if6JC/iGEnhxO/PbeMPCY6muYsq6tAYP9r549rJqhNQe883TiZ00ppwu9LDbSTYn4ScA T7d4C+pgbDy0hmP6MQlw3FCmG0wi6omd4tB9aimeYqkVLzQ7L1zByMThYKuSXKLQLO83 FTQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id l75si2855052qke.56.2017.12.11.13.02.02; Mon, 11 Dec 2017 13:02:02 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 1CF4760956; Mon, 11 Dec 2017 21:02:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 7015F6098A; Mon, 11 Dec 2017 21:00:36 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 4B477608E6; Mon, 11 Dec 2017 21:00:27 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id 13AA36074A for ; Mon, 11 Dec 2017 21:00:25 +0000 (UTC) Received: from mxback13g.mail.yandex.net (mxback13g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:92]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 9F71C2D81411 for ; Tue, 12 Dec 2017 00:00:23 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback13g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 8ngjrCq5ad-0NVKggmR; Tue, 12 Dec 2017 00:00:23 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id YE9KORLQTE-0Mb037C7; Tue, 12 Dec 2017 00:00:22 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 12 Dec 2017 00:00:20 +0300 Message-Id: <1513026020-24993-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513026020-24993-1-git-send-email-odpbot@yandex.ru> References: <1513026020-24993-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 325 Subject: [lng-odp] [PATCH v3 3/3] linux-generic: pool: avoid direct use of printf() in odp_pool_print() X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Bill Fischofer Use ODP_PRINT() rather than printf() to send output through the log function. Signed-off-by: Bill Fischofer --- /** 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 | 54 +++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index d0e4674f9..abd5ef07a 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -924,33 +924,33 @@ void odp_pool_print(odp_pool_t pool_hdl) pool = pool_entry_from_hdl(pool_hdl); - printf("\nPool info\n"); - printf("---------\n"); - printf(" pool %" PRIu64 "\n", - odp_pool_to_u64(pool->pool_hdl)); - printf(" name %s\n", pool->name); - printf(" pool type %s\n", - pool->params.type == ODP_POOL_BUFFER ? "buffer" : - (pool->params.type == ODP_POOL_PACKET ? "packet" : - (pool->params.type == ODP_POOL_TIMEOUT ? "timeout" : - "unknown"))); - printf(" pool shm %" PRIu64 "\n", - odp_shm_to_u64(pool->shm)); - printf(" user area shm %" PRIu64 "\n", - odp_shm_to_u64(pool->uarea_shm)); - printf(" num %u\n", pool->num); - printf(" align %u\n", pool->align); - printf(" headroom %u\n", pool->headroom); - printf(" seg len %u\n", pool->seg_len); - printf(" max data len %u\n", pool->max_len); - printf(" tailroom %u\n", pool->tailroom); - printf(" block size %u\n", pool->block_size); - printf(" uarea size %u\n", pool->uarea_size); - printf(" shm size %u\n", pool->shm_size); - printf(" base addr %p\n", pool->base_addr); - printf(" uarea shm size %u\n", pool->uarea_shm_size); - printf(" uarea base addr %p\n", pool->uarea_base_addr); - printf("\n"); + ODP_PRINT("\nPool info\n"); + ODP_PRINT("---------\n"); + ODP_PRINT(" pool %" PRIu64 "\n", + odp_pool_to_u64(pool->pool_hdl)); + ODP_PRINT(" name %s\n", pool->name); + ODP_PRINT(" pool type %s\n", + pool->params.type == ODP_POOL_BUFFER ? "buffer" : + (pool->params.type == ODP_POOL_PACKET ? "packet" : + (pool->params.type == ODP_POOL_TIMEOUT ? "timeout" : + "unknown"))); + ODP_PRINT(" pool shm %" PRIu64 "\n", + odp_shm_to_u64(pool->shm)); + ODP_PRINT(" user area shm %" PRIu64 "\n", + odp_shm_to_u64(pool->uarea_shm)); + ODP_PRINT(" num %u\n", pool->num); + ODP_PRINT(" align %u\n", pool->align); + ODP_PRINT(" headroom %u\n", pool->headroom); + ODP_PRINT(" seg len %u\n", pool->seg_len); + ODP_PRINT(" max data len %u\n", pool->max_len); + ODP_PRINT(" tailroom %u\n", pool->tailroom); + ODP_PRINT(" block size %u\n", pool->block_size); + ODP_PRINT(" uarea size %u\n", pool->uarea_size); + ODP_PRINT(" shm size %u\n", pool->shm_size); + ODP_PRINT(" base addr %p\n", pool->base_addr); + ODP_PRINT(" uarea shm size %u\n", pool->uarea_shm_size); + ODP_PRINT(" uarea base addr %p\n", pool->uarea_base_addr); + ODP_PRINT("\n"); } odp_pool_t odp_buffer_pool(odp_buffer_t buf)