[v5,07/11] baseband/fpga: use rte_pktmbuf_offset

Message ID 20230708015718.75565-8-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series use rte_pktmbuf_mto_offset |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger July 8, 2023, 1:57 a.m. UTC
  Replace explicit packet offset computations with rte_pktmbuf_mtod_offset().

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
  

Patch

diff --git a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
index f29565af8cca..465a65f3dca2 100644
--- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
+++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
@@ -1543,8 +1543,7 @@  fpga_harq_write_loopback(struct fpga_queue *q,
 		rte_bbdev_log(ERR, "HARQ in length > HARQ buffer size\n");
 	}
 
-	input = (uint64_t *)rte_pktmbuf_mtod_offset(harq_input,
-			uint8_t *, in_offset);
+	input = rte_pktmbuf_mtod_offset(harq_input, uint64_t *, in_offset);
 
 	while (left_length > 0) {
 		if (fpga_reg_read_8(q->d->mmio_base,
@@ -1621,8 +1620,8 @@  fpga_harq_read_loopback(struct fpga_queue *q,
 	}
 	left_length = harq_in_length;
 
-	input = (uint64_t *)rte_pktmbuf_mtod_offset(harq_output,
-			uint8_t *, harq_out_offset);
+	input = rte_pktmbuf_mtod_offset(harq_output, uint64_t *,
+					harq_out_offset);
 
 	while (left_length > 0) {
 		fpga_reg_write_32(q->d->mmio_base,