提交 6c830fef 编写于 作者: D David S. Miller

[SPARC64]: Fix sparse warnings in arch/sparc64/kernel/iommu.c

Fix local variable shadowing in dma_4u_map_sg().

Mark sun4u_dma_ops static.
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 99cd2201
...@@ -626,7 +626,7 @@ static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist, ...@@ -626,7 +626,7 @@ static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist,
iommu_map_failed: iommu_map_failed:
for_each_sg(sglist, s, nelems, i) { for_each_sg(sglist, s, nelems, i) {
if (s->dma_length != 0) { if (s->dma_length != 0) {
unsigned long vaddr, npages, entry, i; unsigned long vaddr, npages, entry, j;
iopte_t *base; iopte_t *base;
vaddr = s->dma_address & IO_PAGE_MASK; vaddr = s->dma_address & IO_PAGE_MASK;
...@@ -637,8 +637,8 @@ static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist, ...@@ -637,8 +637,8 @@ static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist,
>> IO_PAGE_SHIFT; >> IO_PAGE_SHIFT;
base = iommu->page_table + entry; base = iommu->page_table + entry;
for (i = 0; i < npages; i++) for (j = 0; j < npages; j++)
iopte_make_dummy(iommu, base + i); iopte_make_dummy(iommu, base + j);
s->dma_address = DMA_ERROR_CODE; s->dma_address = DMA_ERROR_CODE;
s->dma_length = 0; s->dma_length = 0;
...@@ -803,7 +803,7 @@ static void dma_4u_sync_sg_for_cpu(struct device *dev, ...@@ -803,7 +803,7 @@ static void dma_4u_sync_sg_for_cpu(struct device *dev,
spin_unlock_irqrestore(&iommu->lock, flags); spin_unlock_irqrestore(&iommu->lock, flags);
} }
const struct dma_ops sun4u_dma_ops = { static const struct dma_ops sun4u_dma_ops = {
.alloc_coherent = dma_4u_alloc_coherent, .alloc_coherent = dma_4u_alloc_coherent,
.free_coherent = dma_4u_free_coherent, .free_coherent = dma_4u_free_coherent,
.map_single = dma_4u_map_single, .map_single = dma_4u_map_single,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册