[v2,12/14] crypto/caam_jr: use rte_pktmbuf_mtod_offset

Message ID 20230506160404.7423-13-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series rte_pktmbuf_mtod_offset usage |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger May 6, 2023, 4:04 p.m. UTC
  Autogenerated with cocci/mtod-offset.cocci.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/caam_jr/caam_jr.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Patch

diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c
index b55258689b49..9c96fd21a48d 100644
--- a/drivers/crypto/caam_jr/caam_jr.c
+++ b/drivers/crypto/caam_jr/caam_jr.c
@@ -631,15 +631,15 @@  hw_poll_job_ring(struct sec_job_ring_t *job_ring,
 
 			if (ctx->op->sym->m_dst) {
 				/*TODO check for ip header or other*/
-				ip4_hdr = (struct ip *)
-				rte_pktmbuf_mtod(ctx->op->sym->m_dst, char*);
+				ip4_hdr = rte_pktmbuf_mtod(ctx->op->sym->m_dst,
+							   struct ip *);
 				ctx->op->sym->m_dst->pkt_len =
 					rte_be_to_cpu_16(ip4_hdr->ip_len);
 				ctx->op->sym->m_dst->data_len =
 					rte_be_to_cpu_16(ip4_hdr->ip_len);
 			} else {
-				ip4_hdr = (struct ip *)
-				rte_pktmbuf_mtod(ctx->op->sym->m_src, char*);
+				ip4_hdr = rte_pktmbuf_mtod(ctx->op->sym->m_src,
+							   struct ip *);
 				ctx->op->sym->m_src->pkt_len =
 					rte_be_to_cpu_16(ip4_hdr->ip_len);
 				ctx->op->sym->m_src->data_len =