Skip to content

Commit c1ebb94

Browse files
committed
parisc: sba-iommu: Fix sparse warnigs
Fix sparse warnings, as pdir is __le64 *. Signed-off-by: Helge Deller <[email protected]>
1 parent eb3255e commit c1ebb94

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

arch/parisc/include/asm/ropes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
struct ioc {
3030
void __iomem *ioc_hpa; /* I/O MMU base address */
3131
char *res_map; /* resource map, bit == pdir entry */
32-
u64 *pdir_base; /* physical base address */
32+
__le64 *pdir_base; /* physical base address */
3333
unsigned long ibase; /* pdir IOV Space base - shared w/lba_pci */
3434
unsigned long imask; /* pdir IOV Space mask - shared w/lba_pci */
3535
#ifdef ZX1_SUPPORT
@@ -113,7 +113,7 @@ static inline int IS_PLUTO(struct parisc_device *d) {
113113

114114
#define SBA_PDIR_VALID_BIT 0x8000000000000000ULL
115115

116-
#define SBA_AGPGART_COOKIE 0x0000badbadc0ffeeULL
116+
#define SBA_AGPGART_COOKIE (__force __le64) 0x0000badbadc0ffeeULL
117117

118118
#define SBA_FUNC_ID 0x0000 /* function id */
119119
#define SBA_FCLASS 0x0008 /* function class, bist, header, rev... */

drivers/parisc/iommu-helpers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
static inline unsigned int
1515
iommu_fill_pdir(struct ioc *ioc, struct scatterlist *startsg, int nents,
1616
unsigned long hint,
17-
void (*iommu_io_pdir_entry)(u64 *, space_t, unsigned long,
17+
void (*iommu_io_pdir_entry)(__le64 *, space_t, unsigned long,
1818
unsigned long))
1919
{
2020
struct scatterlist *dma_sg = startsg; /* pointer to current DMA */
2121
unsigned int n_mappings = 0;
2222
unsigned long dma_offset = 0, dma_len = 0;
23-
u64 *pdirp = NULL;
23+
__le64 *pdirp = NULL;
2424

2525
/* Horrible hack. For efficiency's sake, dma_sg starts one
2626
* entry below the true start (it is immediately incremented

drivers/parisc/sba_iommu.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ static void
202202
sba_dump_pdir_entry(struct ioc *ioc, char *msg, uint pide)
203203
{
204204
/* start printing from lowest pde in rval */
205-
u64 *ptr = &(ioc->pdir_base[pide & (~0U * BITS_PER_LONG)]);
205+
__le64 *ptr = &(ioc->pdir_base[pide & (~0U * BITS_PER_LONG)]);
206206
unsigned long *rptr = (unsigned long *) &(ioc->res_map[(pide >>3) & ~(sizeof(unsigned long) - 1)]);
207207
uint rcnt;
208208

@@ -569,7 +569,7 @@ typedef unsigned long space_t;
569569
*/
570570

571571
static void
572-
sba_io_pdir_entry(u64 *pdir_ptr, space_t sid, unsigned long vba,
572+
sba_io_pdir_entry(__le64 *pdir_ptr, space_t sid, unsigned long vba,
573573
unsigned long hint)
574574
{
575575
u64 pa; /* physical address */
@@ -613,7 +613,7 @@ static void
613613
sba_mark_invalid(struct ioc *ioc, dma_addr_t iova, size_t byte_cnt)
614614
{
615615
u32 iovp = (u32) SBA_IOVP(ioc,iova);
616-
u64 *pdir_ptr = &ioc->pdir_base[PDIR_INDEX(iovp)];
616+
__le64 *pdir_ptr = &ioc->pdir_base[PDIR_INDEX(iovp)];
617617

618618
#ifdef ASSERT_PDIR_SANITY
619619
/* Assert first pdir entry is set.
@@ -714,7 +714,7 @@ sba_map_single(struct device *dev, void *addr, size_t size,
714714
unsigned long flags;
715715
dma_addr_t iovp;
716716
dma_addr_t offset;
717-
u64 *pdir_start;
717+
__le64 *pdir_start;
718718
int pide;
719719

720720
ioc = GET_IOC(dev);
@@ -1432,7 +1432,7 @@ sba_ioc_init(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
14321432

14331433
ioc->pdir_size = pdir_size = (iova_space_size/IOVP_SIZE) * sizeof(u64);
14341434

1435-
DBG_INIT("%s() hpa 0x%lx mem %ldMB IOV %dMB (%d bits)\n",
1435+
DBG_INIT("%s() hpa %px mem %ldMB IOV %dMB (%d bits)\n",
14361436
__func__,
14371437
ioc->ioc_hpa,
14381438
(unsigned long) totalram_pages() >> (20 - PAGE_SHIFT),
@@ -1469,7 +1469,7 @@ sba_ioc_init(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
14691469
ioc->iovp_mask = ~(iova_space_mask + PAGE_SIZE - 1);
14701470
#endif
14711471

1472-
DBG_INIT("%s() IOV base 0x%lx mask 0x%0lx\n",
1472+
DBG_INIT("%s() IOV base %#lx mask %#0lx\n",
14731473
__func__, ioc->ibase, ioc->imask);
14741474

14751475
/*
@@ -1581,7 +1581,7 @@ printk("sba_hw_init(): mem_boot 0x%x 0x%x 0x%x 0x%x\n", PAGE0->mem_boot.hpa,
15811581

15821582
if (!IS_PLUTO(sba_dev->dev)) {
15831583
ioc_ctl = READ_REG(sba_dev->sba_hpa+IOC_CTRL);
1584-
DBG_INIT("%s() hpa 0x%lx ioc_ctl 0x%Lx ->",
1584+
DBG_INIT("%s() hpa %px ioc_ctl 0x%Lx ->",
15851585
__func__, sba_dev->sba_hpa, ioc_ctl);
15861586
ioc_ctl &= ~(IOC_CTRL_RM | IOC_CTRL_NC | IOC_CTRL_CE);
15871587
ioc_ctl |= IOC_CTRL_DD | IOC_CTRL_D4 | IOC_CTRL_TC;
@@ -1666,14 +1666,14 @@ printk("sba_hw_init(): mem_boot 0x%x 0x%x 0x%x 0x%x\n", PAGE0->mem_boot.hpa,
16661666
/* flush out the last writes */
16671667
READ_REG(sba_dev->ioc[i].ioc_hpa + ROPE7_CTL);
16681668

1669-
DBG_INIT(" ioc[%d] ROPE_CFG 0x%Lx ROPE_DBG 0x%Lx\n",
1669+
DBG_INIT(" ioc[%d] ROPE_CFG %#lx ROPE_DBG %lx\n",
16701670
i,
1671-
READ_REG(sba_dev->ioc[i].ioc_hpa + 0x40),
1672-
READ_REG(sba_dev->ioc[i].ioc_hpa + 0x50)
1671+
(unsigned long) READ_REG(sba_dev->ioc[i].ioc_hpa + 0x40),
1672+
(unsigned long) READ_REG(sba_dev->ioc[i].ioc_hpa + 0x50)
16731673
);
1674-
DBG_INIT(" STATUS_CONTROL 0x%Lx FLUSH_CTRL 0x%Lx\n",
1675-
READ_REG(sba_dev->ioc[i].ioc_hpa + 0x108),
1676-
READ_REG(sba_dev->ioc[i].ioc_hpa + 0x400)
1674+
DBG_INIT(" STATUS_CONTROL %#lx FLUSH_CTRL %#lx\n",
1675+
(unsigned long) READ_REG(sba_dev->ioc[i].ioc_hpa + 0x108),
1676+
(unsigned long) READ_REG(sba_dev->ioc[i].ioc_hpa + 0x400)
16771677
);
16781678

16791679
if (IS_PLUTO(sba_dev->dev)) {
@@ -1737,7 +1737,7 @@ sba_common_init(struct sba_device *sba_dev)
17371737
#ifdef ASSERT_PDIR_SANITY
17381738
/* Mark first bit busy - ie no IOVA 0 */
17391739
sba_dev->ioc[i].res_map[0] = 0x80;
1740-
sba_dev->ioc[i].pdir_base[0] = 0xeeffc0addbba0080ULL;
1740+
sba_dev->ioc[i].pdir_base[0] = (__force __le64) 0xeeffc0addbba0080ULL;
17411741
#endif
17421742

17431743
/* Third (and last) part of PIRANHA BUG */

0 commit comments

Comments
 (0)