From patchwork Tue Jan 23 09:48:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Zhiyong" X-Patchwork-Id: 34306 X-Patchwork-Delegate: pablo.de.lara.guarch@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 81CC61B03D; Tue, 23 Jan 2018 10:48:23 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id EF62B1B03C; Tue, 23 Jan 2018 10:48:21 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jan 2018 01:48:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,400,1511856000"; d="scan'208";a="195561509" Received: from unknown (HELO dpdk5.bj.intel.com) ([172.16.182.198]) by orsmga005.jf.intel.com with ESMTP; 23 Jan 2018 01:48:17 -0800 From: Zhiyong Yang To: dev@dpdk.org Cc: ferruh.yigit@intel.com, thomas@monjalon.net, stable@dpdk.org, declan.doherty@intel.com, akhil.goyal@nxp.com, Zhiyong Yang Date: Tue, 23 Jan 2018 17:48:13 +0800 Message-Id: <20180123094813.65813-1-zhiyong.yang@intel.com> X-Mailer: git-send-email 2.13.3 Subject: [dpdk-dev] [PATCH] lib: fix wrong cast X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The wrong casts don't cause actual error, but they should conform to C standard. Fixes: c261d1431bd8 ("security: introduce security API and framework") Fixes: b3bbd9e5f265 ("cryptodev: support device independent sessions") Cc: stable@dpdk.org Cc: declan.doherty@intel.com Cc: akhil.goyal@nxp.com Signed-off-by: Zhiyong Yang Acked-by: Akhil Goyal Acked-by: Pablo de Lara --- lib/librte_cryptodev/rte_cryptodev.c | 2 +- lib/librte_security/rte_security.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index 7726d15f4..8745b6b02 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -1094,7 +1094,7 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mp) struct rte_cryptodev_sym_session *sess; /* Allocate a session structure from the session pool */ - if (rte_mempool_get(mp, (void *)&sess)) { + if (rte_mempool_get(mp, (void **)&sess)) { CDEV_LOG_ERR("couldn't get object from session mempool"); return NULL; } diff --git a/lib/librte_security/rte_security.c b/lib/librte_security/rte_security.c index 6461dba05..d98f46dea 100644 --- a/lib/librte_security/rte_security.c +++ b/lib/librte_security/rte_security.c @@ -49,7 +49,7 @@ rte_security_session_create(struct rte_security_ctx *instance, RTE_FUNC_PTR_OR_ERR_RET(*instance->ops->session_create, NULL); - if (rte_mempool_get(mp, (void *)&sess)) + if (rte_mempool_get(mp, (void **)&sess)) return NULL; if (instance->ops->session_create(instance->device, conf, sess, mp)) {