[v3,09/14] crypto/qat: use rte_pktmbuf_mtod_offset

Message ID 20230706175938.62721-10-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Use rte_pktmbuf_mtod_offset() where possible |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger July 6, 2023, 5:59 p.m. UTC
  Auto generated with cocci/mtod-offset.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/qat/dev/qat_crypto_pmd_gens.h | 9 +++++----
 drivers/crypto/qat/qat_sym.h                 | 9 +++++----
 2 files changed, 10 insertions(+), 8 deletions(-)
  

Patch

diff --git a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h
index 1bafeb4a53e8..3e0dfea94c87 100644
--- a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h
+++ b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h
@@ -56,14 +56,15 @@  qat_bpicipher_preprocess(struct qat_sym_session *ctx,
 		uint8_t *last_block, *dst, *iv;
 		uint32_t last_block_offset = sym_op->cipher.data.offset +
 				sym_op->cipher.data.length - last_block_len;
-		last_block = (uint8_t *) rte_pktmbuf_mtod_offset(sym_op->m_src,
-				uint8_t *, last_block_offset);
+		last_block = rte_pktmbuf_mtod_offset(sym_op->m_src, uint8_t *,
+						     last_block_offset);
 
 		if (unlikely((sym_op->m_dst != NULL)
 				&& (sym_op->m_dst != sym_op->m_src)))
 			/* out-of-place operation (OOP) */
-			dst = (uint8_t *) rte_pktmbuf_mtod_offset(sym_op->m_dst,
-						uint8_t *, last_block_offset);
+			dst = rte_pktmbuf_mtod_offset(sym_op->m_dst,
+						      uint8_t *,
+						      last_block_offset);
 		else
 			dst = last_block;
 
diff --git a/drivers/crypto/qat/qat_sym.h b/drivers/crypto/qat/qat_sym.h
index 193281cd9135..d7ceb13b29cd 100644
--- a/drivers/crypto/qat/qat_sym.h
+++ b/drivers/crypto/qat/qat_sym.h
@@ -192,13 +192,14 @@  qat_bpicipher_postprocess(struct qat_sym_session *ctx,
 
 		last_block_offset = sym_op->cipher.data.offset +
 				sym_op->cipher.data.length - last_block_len;
-		last_block = (uint8_t *) rte_pktmbuf_mtod_offset(sym_op->m_src,
-				uint8_t *, last_block_offset);
+		last_block = rte_pktmbuf_mtod_offset(sym_op->m_src, uint8_t *,
+						     last_block_offset);
 
 		if (unlikely(sym_op->m_dst != NULL))
 			/* out-of-place operation (OOP) */
-			dst = (uint8_t *) rte_pktmbuf_mtod_offset(sym_op->m_dst,
-						uint8_t *, last_block_offset);
+			dst = rte_pktmbuf_mtod_offset(sym_op->m_dst,
+						      uint8_t *,
+						      last_block_offset);
 		else
 			dst = last_block;