Autogenerated with cocci/mtod-offset.cocci Signed-off-by: Stephen Hemminger <step...@networkplumber.org> --- drivers/crypto/cnxk/cn9k_cryptodev_ops.c | 2 +- drivers/crypto/cnxk/cnxk_se.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c index 34d40b07d4c6..8b91d11b79cc 100644 --- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c +++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c @@ -520,7 +520,7 @@ cn9k_cpt_sec_post_process(struct rte_crypto_op *cop, if (infl_req->op_flags & CPT_OP_FLAGS_IPSEC_DIR_INBOUND) { - hdr = (struct roc_ie_on_inb_hdr *)rte_pktmbuf_mtod(m, char *); + hdr = rte_pktmbuf_mtod(m, struct roc_ie_on_inb_hdr *); if (likely(m->next == NULL)) { ip = PLT_PTR_ADD(hdr, ROC_IE_ON_INB_RPTR_HDR); diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h index 75c1dce231bf..1392af5833d1 100644 --- a/drivers/crypto/cnxk/cnxk_se.h +++ b/drivers/crypto/cnxk/cnxk_se.h @@ -2724,7 +2724,7 @@ fill_fc_params(struct rte_crypto_op *cop, struct cnxk_se_sess *sess, m = cpt_m_dst_get(cpt_op, m_src, m_dst); /* Digest immediately following data is best case */ - if (unlikely(rte_pktmbuf_mtod(m, uint8_t *) + mc_hash_off != + if (unlikely(rte_pktmbuf_mtod_offset(m, uint8_t *, mc_hash_off) != (uint8_t *)sym_op->aead.digest.data)) { flags |= ROC_SE_VALID_MAC_BUF; fc_params.mac_buf.size = sess->mac_len; @@ -2759,8 +2759,7 @@ fill_fc_params(struct rte_crypto_op *cop, struct cnxk_se_sess *sess, /* hmac immediately following data is best case */ if (!(op_minor & ROC_SE_FC_MINOR_OP_HMAC_FIRST) && - (unlikely(rte_pktmbuf_mtod(m, uint8_t *) + - mc_hash_off != + (unlikely(rte_pktmbuf_mtod_offset(m, uint8_t *, mc_hash_off) != (uint8_t *)sym_op->auth.digest.data))) { flags |= ROC_SE_VALID_MAC_BUF; fc_params.mac_buf.size = sess->mac_len; -- 2.39.2