swiotlb-xen: replace dma_length with sg_dma_len() macro
swiotlb-xen has an implicit dependency on CONFIG_NEED_SG_DMA_LENGTH. Remove it by replacing dma_length with sg_dma_len. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This commit is contained in:
committed by
Konrad Rzeszutek Wilk
parent
4d86ec7a8a
commit
781575cd81
@@ -506,13 +506,13 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl,
|
|||||||
to do proper error handling. */
|
to do proper error handling. */
|
||||||
xen_swiotlb_unmap_sg_attrs(hwdev, sgl, i, dir,
|
xen_swiotlb_unmap_sg_attrs(hwdev, sgl, i, dir,
|
||||||
attrs);
|
attrs);
|
||||||
sgl[0].dma_length = 0;
|
sg_dma_len(sgl) = 0;
|
||||||
return DMA_ERROR_CODE;
|
return DMA_ERROR_CODE;
|
||||||
}
|
}
|
||||||
sg->dma_address = xen_phys_to_bus(map);
|
sg->dma_address = xen_phys_to_bus(map);
|
||||||
} else
|
} else
|
||||||
sg->dma_address = dev_addr;
|
sg->dma_address = dev_addr;
|
||||||
sg->dma_length = sg->length;
|
sg_dma_len(sg) = sg->length;
|
||||||
}
|
}
|
||||||
return nelems;
|
return nelems;
|
||||||
}
|
}
|
||||||
@@ -533,7 +533,7 @@ xen_swiotlb_unmap_sg_attrs(struct device *hwdev, struct scatterlist *sgl,
|
|||||||
BUG_ON(dir == DMA_NONE);
|
BUG_ON(dir == DMA_NONE);
|
||||||
|
|
||||||
for_each_sg(sgl, sg, nelems, i)
|
for_each_sg(sgl, sg, nelems, i)
|
||||||
xen_unmap_single(hwdev, sg->dma_address, sg->dma_length, dir);
|
xen_unmap_single(hwdev, sg->dma_address, sg_dma_len(sg), dir);
|
||||||
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(xen_swiotlb_unmap_sg_attrs);
|
EXPORT_SYMBOL_GPL(xen_swiotlb_unmap_sg_attrs);
|
||||||
@@ -555,7 +555,7 @@ xen_swiotlb_sync_sg(struct device *hwdev, struct scatterlist *sgl,
|
|||||||
|
|
||||||
for_each_sg(sgl, sg, nelems, i)
|
for_each_sg(sgl, sg, nelems, i)
|
||||||
xen_swiotlb_sync_single(hwdev, sg->dma_address,
|
xen_swiotlb_sync_single(hwdev, sg->dma_address,
|
||||||
sg->dma_length, dir, target);
|
sg_dma_len(sg), dir, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user