[10/14] crypto/cnxk: use rte_ptkmbuf_mtod_offset
Checks
Commit Message
Autogenerated with cocci/mtod-offset.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/crypto/cnxk/cn9k_cryptodev_ops.c | 2 +-
drivers/crypto/cnxk/cnxk_se.h | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
@@ -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);
@@ -2275,7 +2275,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;
@@ -2310,8 +2310,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;