[openib-general] [PATCH] Being more anal about iospace accesses..
Tom Duffy
tduffy at sun.com
Mon Sep 20 13:20:16 PDT 2004
This may not be *all* of it, but it gets rid of the build warnings on
gcc 3.3 on x86. Also built cleanly on x86_64 and sparc64.
Signed-off by: Tom Duffy <tduffy at sun.com> with permission from Sun
legal.
Index: drivers/infiniband/hw/mthca/mthca_dev.h
===================================================================
--- drivers/infiniband/hw/mthca/mthca_dev.h (revision 872)
+++ drivers/infiniband/hw/mthca/mthca_dev.h (working copy)
@@ -145,7 +145,7 @@
struct mthca_eq_table {
struct mthca_alloc alloc;
- unsigned long clr_int;
+ void __iomem *clr_int;
u32 clr_mask;
struct mthca_eq eq[MTHCA_NUM_EQ];
int have_irq;
@@ -169,7 +169,7 @@
struct pci_pool *pool;
int num_ddr_avs;
u64 ddr_av_base;
- unsigned long av_map;
+ void __iomem *av_map;
struct mthca_alloc alloc;
};
@@ -195,9 +195,9 @@
MTHCA_DECLARE_DOORBELL_LOCK(doorbell_lock)
- unsigned long hcr;
- unsigned long clr_base;
- unsigned long kar;
+ void __iomem *hcr;
+ void __iomem *clr_base;
+ void __iomem *kar;
struct mthca_cmd cmd;
struct mthca_limits limits;
Index: drivers/infiniband/hw/mthca/mthca_main.c
===================================================================
--- drivers/infiniband/hw/mthca/mthca_main.c (revision 872)
+++ drivers/infiniband/hw/mthca/mthca_main.c (working copy)
@@ -535,17 +535,15 @@
mdev->cmd.use_events = 0;
mthca_base = pci_resource_start(pdev, 0);
- mdev->hcr = (unsigned long) ioremap(mthca_base + MTHCA_HCR_BASE,
- MTHCA_MAP_HCR_SIZE);
+ mdev->hcr = ioremap(mthca_base + MTHCA_HCR_BASE, MTHCA_MAP_HCR_SIZE);
if (!mdev->hcr) {
mthca_err(mdev, "Couldn't map command register, "
"aborting.\n");
err = -ENOMEM;
goto err_out_free_dev;
}
- mdev->clr_base =
- (unsigned long) ioremap(mthca_base + MTHCA_CLR_INT_BASE,
- MTHCA_CLR_INT_SIZE);
+ mdev->clr_base = ioremap(mthca_base + MTHCA_CLR_INT_BASE,
+ MTHCA_CLR_INT_SIZE);
if (!mdev->clr_base) {
mthca_err(mdev, "Couldn't map command register, "
"aborting.\n");
@@ -554,9 +552,7 @@
}
mthca_base = pci_resource_start(pdev, 2);
- mdev->kar = (unsigned long) ioremap(mthca_base +
- PAGE_SIZE * MTHCA_KAR_PAGE,
- PAGE_SIZE);
+ mdev->kar = ioremap(mthca_base + PAGE_SIZE * MTHCA_KAR_PAGE, PAGE_SIZE);
if (!mdev->kar) {
mthca_err(mdev, "Couldn't map kernel access region, "
"aborting.\n");
Index: drivers/infiniband/hw/mthca/mthca_av.c
===================================================================
--- drivers/infiniband/hw/mthca/mthca_av.c (revision 872)
+++ drivers/infiniband/hw/mthca/mthca_av.c (working copy)
@@ -175,12 +175,12 @@
goto out_free_alloc;
if (!(dev->mthca_flags & MTHCA_FLAG_DDR_HIDDEN)) {
- dev->av_table.av_map =
- (unsigned long) ioremap(pci_resource_start(dev->pdev, 4) +
- dev->av_table.ddr_av_base -
- dev->ddr_start,
- dev->av_table.num_ddr_avs *
- MTHCA_AV_SIZE);
+ dev->av_table.av_map = ioremap(pci_resource_start(dev->pdev,
+ 4) +
+ dev->av_table.ddr_av_base -
+ dev->ddr_start,
+ dev->av_table.num_ddr_avs *
+ MTHCA_AV_SIZE);
if (!dev->av_table.av_map)
goto out_free_pool;
} else
Index: drivers/infiniband/hw/mthca/mthca_doorbell.h
===================================================================
--- drivers/infiniband/hw/mthca/mthca_doorbell.h (revision 872)
+++ drivers/infiniband/hw/mthca/mthca_doorbell.h (working copy)
@@ -42,7 +42,7 @@
#define MTHCA_INIT_DOORBELL_LOCK(ptr) do { } while (0)
#define MTHCA_GET_DOORBELL_LOCK(ptr) (0)
-static inline void mthca_write64(u32 val[2], unsigned long dest,
+static inline void mthca_write64(u32 val[2], void __iomem *dest,
spinlock_t *doorbell_lock)
{
writeq(cpu_to_le64p((u64 *) val), dest);
@@ -70,7 +70,7 @@
preempt_enable();
}
-static inline void mthca_write64(u32 val[2], unsigned long dest,
+static inline void mthca_write64(u32 val[2], void __iomem *dest,
spinlock_t *doorbell_lock)
{
/* i386 stack is aligned to 8 bytes, so this should be OK: */
@@ -98,7 +98,7 @@
#define MTHCA_INIT_DOORBELL_LOCK(ptr) spin_lock_init(ptr)
#define MTHCA_GET_DOORBELL_LOCK(ptr) (ptr)
-static inline void mthca_write64(u32 val[2], unsigned long dest,
+static inline void mthca_write64(u32 val[2], void __iomem *dest,
spinlock_t *doorbell_lock)
{
unsigned long flags;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20040920/64bbce40/attachment.sig>
More information about the general
mailing list