baseband/fpga_5gnr_fec: remove useless cast

Message ID 20240725171727.142525-1-stephen@networkplumber.org (mailing list archive)
State Awaiting Upstream
Delegated to: Maxime Coquelin
Headers
Series baseband/fpga_5gnr_fec: remove useless cast |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Stephen Hemminger July 25, 2024, 5:17 p.m. UTC
The rte_pktmbuf_mtod_offset macro already includes a type cast
so casting the result just adds extra cast.
Found by cocci/mtod-offset.cocci

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

Comments

Maxime Coquelin Sept. 10, 2024, 3:13 p.m. UTC | #1
On 7/25/24 19:17, Stephen Hemminger wrote:
> The rte_pktmbuf_mtod_offset macro already includes a type cast
> so casting the result just adds extra cast.
> Found by cocci/mtod-offset.cocci
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>   drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 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 9b253cde28..e2ed047836 100644
> --- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
> +++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
> @@ -2042,7 +2042,7 @@ fpga_5gnr_harq_write_loopback(struct fpga_5gnr_queue *q,
>   		}
>   	}
>   
> -	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_5gnr_reg_read_8(q->d->mmio_base, FPGA_5GNR_FEC_DDR4_ADDR_RDY_REGS) ==  1) {
> @@ -2125,7 +2125,7 @@ fpga_5gnr_harq_read_loopback(struct fpga_5gnr_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) {
>   		if (d->fpga_variant == AGX100_FPGA_VARIANT) {

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  
Maxime Coquelin Sept. 13, 2024, 1:50 p.m. UTC | #2
On 7/25/24 19:17, Stephen Hemminger wrote:
> The rte_pktmbuf_mtod_offset macro already includes a type cast
> so casting the result just adds extra cast.
> Found by cocci/mtod-offset.cocci
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>   drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Applied to dpdk-next-baseband/for-main

Thanks,
Maxime
  

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 9b253cde28..e2ed047836 100644
--- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
+++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
@@ -2042,7 +2042,7 @@  fpga_5gnr_harq_write_loopback(struct fpga_5gnr_queue *q,
 		}
 	}
 
-	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_5gnr_reg_read_8(q->d->mmio_base, FPGA_5GNR_FEC_DDR4_ADDR_RDY_REGS) ==  1) {
@@ -2125,7 +2125,7 @@  fpga_5gnr_harq_read_loopback(struct fpga_5gnr_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) {
 		if (d->fpga_variant == AGX100_FPGA_VARIANT) {