DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anoob Joseph <anoobj@marvell.com>
To: Akhil Goyal <gakhil@marvell.com>, Ciara Power <ciara.power@intel.com>
Cc: Jerin Jacob <jerinj@marvell.com>, <dev@dpdk.org>
Subject: [PATCH 2/4] test/crypto: remove redundant cast
Date: Fri, 8 Sep 2023 11:10:01 +0530	[thread overview]
Message-ID: <20230908054003.295-2-anoobj@marvell.com> (raw)
In-Reply-To: <20230908054003.295-1-anoobj@marvell.com>

The API 'rte_cryptodev_get_sec_ctx' returns void *. Type cast is not
required.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 app/test/test_cryptodev.c | 29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index fb2af40b99..589b9860ce 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -8920,15 +8920,12 @@ security_proto_supported(enum rte_security_session_action_type action,
 	enum rte_security_session_protocol proto)
 {
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
-
 	const struct rte_security_capability *capabilities;
 	const struct rte_security_capability *capability;
+	struct rte_security_ctx *ctx;
 	uint16_t i = 0;
 
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-				rte_cryptodev_get_sec_ctx(
-				ts_params->valid_devs[0]);
-
+	ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
 
 	capabilities = rte_security_capabilities_get(ctx);
 
@@ -8967,12 +8964,12 @@ static int test_pdcp_proto(int i, int oop, enum rte_crypto_cipher_operation opc,
 	struct crypto_unittest_params *ut_params = &unittest_params;
 	uint8_t *plaintext;
 	int ret = TEST_SUCCESS;
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-				rte_cryptodev_get_sec_ctx(
-				ts_params->valid_devs[0]);
 	struct rte_cryptodev_info dev_info;
+	struct rte_security_ctx *ctx;
 	uint64_t feat_flags;
 
+	ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
+
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 	feat_flags = dev_info.feature_flags;
 
@@ -9174,11 +9171,11 @@ test_pdcp_proto_SGL(int i, int oop,
 	unsigned int trn_data = 0;
 	struct rte_cryptodev_info dev_info;
 	uint64_t feat_flags;
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-				rte_cryptodev_get_sec_ctx(
-				ts_params->valid_devs[0]);
+	struct rte_security_ctx *ctx;
 	struct rte_mbuf *temp_mbuf;
 
+	ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
+
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 	feat_flags = dev_info.feature_flags;
 
@@ -10898,6 +10895,7 @@ test_docsis_proto_uplink(const void *data)
 	const struct docsis_test_data *d_td = data;
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	struct crypto_unittest_params *ut_params = &unittest_params;
+	struct rte_security_ctx *ctx;
 	uint8_t *plaintext = NULL;
 	uint8_t *ciphertext = NULL;
 	uint8_t *iv_ptr;
@@ -10905,9 +10903,7 @@ test_docsis_proto_uplink(const void *data)
 	uint32_t crc_data_len;
 	int ret = TEST_SUCCESS;
 
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-					rte_cryptodev_get_sec_ctx(
-						ts_params->valid_devs[0]);
+	ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
 
 	/* Verify the capabilities */
 	struct rte_security_capability_idx sec_cap_idx;
@@ -11083,15 +11079,14 @@ test_docsis_proto_downlink(const void *data)
 	const struct docsis_test_data *d_td = data;
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	struct crypto_unittest_params *ut_params = &unittest_params;
+	struct rte_security_ctx *ctx;
 	uint8_t *plaintext = NULL;
 	uint8_t *ciphertext = NULL;
 	uint8_t *iv_ptr;
 	int32_t cipher_len, crc_len;
 	int ret = TEST_SUCCESS;
 
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-					rte_cryptodev_get_sec_ctx(
-						ts_params->valid_devs[0]);
+	ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
 
 	/* Verify the capabilities */
 	struct rte_security_capability_idx sec_cap_idx;
-- 
2.25.1


  reply	other threads:[~2023-09-08  5:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-08  5:40 [PATCH 1/4] security: " Anoob Joseph
2023-09-08  5:40 ` Anoob Joseph [this message]
2023-09-08  5:40 ` [PATCH 3/4] app/crypto-perf: " Anoob Joseph
2023-09-08  5:40 ` [PATCH 4/4] examples/ipsec-secgw: " Anoob Joseph
2023-09-08 10:36 ` [PATCH 1/4] security: " Power, Ciara
2023-09-20 11:18 ` Akhil Goyal

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=20230908054003.295-2-anoobj@marvell.com \
    --to=anoobj@marvell.com \
    --cc=ciara.power@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=jerinj@marvell.com \
    /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).