[PATCH v3 13/14] net/mlx4: use rte_pktmbuf_mtod_offset

Ferruh Yigit ferruh.yigit at amd.com
Fri Jul 7 14:46:22 CEST 2023


On 7/6/2023 6:59 PM, Stephen Hemminger wrote:
> Autogenerated with cocci/mtod-offset.cocci.
> 
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> ---
>  drivers/net/mlx4/mlx4_rxtx.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/mlx4/mlx4_rxtx.c b/drivers/net/mlx4/mlx4_rxtx.c
> index 059e432a63fc..d5feeb7f7e6d 100644
> --- a/drivers/net/mlx4/mlx4_rxtx.c
> +++ b/drivers/net/mlx4/mlx4_rxtx.c
> @@ -1014,9 +1014,9 @@ mlx4_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
>  			 * loopback in eSwitch, so that VFs and PF can
>  			 * communicate with each other.
>  			 */
> -			srcrb.flags16[0] = *(rte_pktmbuf_mtod(buf, uint16_t *));
> -			ctrl->imm = *(rte_pktmbuf_mtod_offset(buf, uint32_t *,
> -					      sizeof(uint16_t)));
> +			srcrb.flags16[0] = *rte_pktmbuf_mtod(buf, uint16_t *);
> +			ctrl->imm = *rte_pktmbuf_mtod_offset(buf, uint32_t *,
> +							     sizeof(uint16_t));
>  		} else {
>  			ctrl->imm = 0;
>  		}

Although parenthesis may not be required, keeping them looks more clear
to me; personal preferences.

And patch title is not accurate for this patch.



More information about the dev mailing list