Skip to content

Commit 9a47a71

Browse files
committed
parisc: ccio-dma: Fix sparse warnings
Signed-off-by: Helge Deller <[email protected]>
1 parent c1ebb94 commit 9a47a71

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

drivers/parisc/ccio-dma.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ struct ioa_registers {
214214
struct ioc {
215215
struct ioa_registers __iomem *ioc_regs; /* I/O MMU base address */
216216
u8 *res_map; /* resource map, bit == pdir entry */
217-
u64 *pdir_base; /* physical base address */
217+
__le64 *pdir_base; /* physical base address */
218218
u32 pdir_size; /* bytes, function of IOV Space size */
219219
u32 res_hint; /* next available IOVP -
220220
circular search */
@@ -339,7 +339,7 @@ ccio_alloc_range(struct ioc *ioc, struct device *dev, size_t size)
339339
BUG_ON(pages_needed == 0);
340340
BUG_ON((pages_needed * IOVP_SIZE) > DMA_CHUNK_SIZE);
341341

342-
DBG_RES("%s() size: %d pages_needed %d\n",
342+
DBG_RES("%s() size: %zu pages_needed %d\n",
343343
__func__, size, pages_needed);
344344

345345
/*
@@ -427,7 +427,7 @@ ccio_free_range(struct ioc *ioc, dma_addr_t iova, unsigned long pages_mapped)
427427
BUG_ON((pages_mapped * IOVP_SIZE) > DMA_CHUNK_SIZE);
428428
BUG_ON(pages_mapped > BITS_PER_LONG);
429429

430-
DBG_RES("%s(): res_idx: %d pages_mapped %d\n",
430+
DBG_RES("%s(): res_idx: %d pages_mapped %lu\n",
431431
__func__, res_idx, pages_mapped);
432432

433433
#ifdef CCIO_COLLECT_STATS
@@ -543,7 +543,7 @@ static u32 hint_lookup[] = {
543543
* index are bits 12:19 of the value returned by LCI.
544544
*/
545545
static void
546-
ccio_io_pdir_entry(u64 *pdir_ptr, space_t sid, unsigned long vba,
546+
ccio_io_pdir_entry(__le64 *pdir_ptr, space_t sid, unsigned long vba,
547547
unsigned long hints)
548548
{
549549
register unsigned long pa;
@@ -719,7 +719,7 @@ ccio_map_single(struct device *dev, void *addr, size_t size,
719719
unsigned long flags;
720720
dma_addr_t iovp;
721721
dma_addr_t offset;
722-
u64 *pdir_start;
722+
__le64 *pdir_start;
723723
unsigned long hint = hint_lookup[(int)direction];
724724

725725
BUG_ON(!dev);
@@ -746,8 +746,8 @@ ccio_map_single(struct device *dev, void *addr, size_t size,
746746

747747
pdir_start = &(ioc->pdir_base[idx]);
748748

749-
DBG_RUN("%s() 0x%p -> 0x%lx size: %0x%x\n",
750-
__func__, addr, (long)iovp | offset, size);
749+
DBG_RUN("%s() %px -> %#lx size: %zu\n",
750+
__func__, addr, (long)(iovp | offset), size);
751751

752752
/* If not cacheline aligned, force SAFE_DMA on the whole mess */
753753
if((size % L1_CACHE_BYTES) || ((unsigned long)addr % L1_CACHE_BYTES))
@@ -805,7 +805,7 @@ ccio_unmap_page(struct device *dev, dma_addr_t iova, size_t size,
805805
return;
806806
}
807807

808-
DBG_RUN("%s() iovp 0x%lx/%x\n",
808+
DBG_RUN("%s() iovp %#lx/%zx\n",
809809
__func__, (long)iova, size);
810810

811811
iova ^= offset; /* clear offset bits */
@@ -1283,7 +1283,7 @@ ccio_ioc_init(struct ioc *ioc)
12831283
iova_space_size>>20,
12841284
iov_order + PAGE_SHIFT);
12851285

1286-
ioc->pdir_base = (u64 *)__get_free_pages(GFP_KERNEL,
1286+
ioc->pdir_base = (__le64 *)__get_free_pages(GFP_KERNEL,
12871287
get_order(ioc->pdir_size));
12881288
if(NULL == ioc->pdir_base) {
12891289
panic("%s() could not allocate I/O Page Table\n", __func__);

drivers/parisc/iommu-helpers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ iommu_fill_pdir(struct ioc *ioc, struct scatterlist *startsg, int nents,
3131
unsigned long vaddr;
3232
long size;
3333

34-
DBG_RUN_SG(" %d : %08lx/%05x %p/%05x\n", nents,
35-
(unsigned long)sg_dma_address(startsg), cnt,
34+
DBG_RUN_SG(" %d : %08lx %p/%05x\n", nents,
35+
(unsigned long)sg_dma_address(startsg),
3636
sg_virt(startsg), startsg->length
3737
);
3838

0 commit comments

Comments
 (0)