[2/4] test/crypto: remove redundant cast

Message ID 20230908054003.295-2-anoobj@marvell.com (mailing list archive)
State Not Applicable, archived
Delegated to: akhil goyal
Headers
Series [1/4] security: remove redundant cast |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Anoob Joseph Sept. 8, 2023, 5:40 a.m. UTC
  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(-)
  

Patch

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;