stmmac: use XDP helpers

Make use of the xdp_{init,prepare}_buff() helpers instead of
an open-coded version.

Signed-off-by: Matteo Croce <mcroce@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Matteo Croce 2021-05-14 20:39:52 +02:00 committed by David S. Miller
parent 76e3d7fade
commit d172268f93

View File

@ -5167,12 +5167,9 @@ read_again:
dma_sync_single_for_cpu(priv->device, buf->addr,
buf1_len, dma_dir);
xdp.data = page_address(buf->page) + buf->page_offset;
xdp.data_end = xdp.data + buf1_len;
xdp.data_hard_start = page_address(buf->page);
xdp_set_data_meta_invalid(&xdp);
xdp.frame_sz = buf_sz;
xdp.rxq = &rx_q->xdp_rxq;
xdp_init_buff(&xdp, buf_sz, &rx_q->xdp_rxq);
xdp_prepare_buff(&xdp, page_address(buf->page),
buf->page_offset, buf1_len, false);
pre_len = xdp.data_end - xdp.data_hard_start -
buf->page_offset;