提交 a0533fbf 编写于 作者: B Benjamin Herrenschmidt 提交者: Dave Airlie

drm/radeon: Remove a bunch of useless _iomem casts

Just defining rdev->rmmio properly in the first place should do
the trick. In some cases, the cast were also complete dups as
the original variable was already of the right type.
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 62cb7011
...@@ -1177,7 +1177,7 @@ struct radeon_device { ...@@ -1177,7 +1177,7 @@ struct radeon_device {
/* Register mmio */ /* Register mmio */
resource_size_t rmmio_base; resource_size_t rmmio_base;
resource_size_t rmmio_size; resource_size_t rmmio_size;
void *rmmio; void __iomem *rmmio;
radeon_rreg_t mc_rreg; radeon_rreg_t mc_rreg;
radeon_wreg_t mc_wreg; radeon_wreg_t mc_wreg;
radeon_rreg_t pll_rreg; radeon_rreg_t pll_rreg;
...@@ -1254,20 +1254,20 @@ int radeon_gpu_wait_for_idle(struct radeon_device *rdev); ...@@ -1254,20 +1254,20 @@ int radeon_gpu_wait_for_idle(struct radeon_device *rdev);
static inline uint32_t r100_mm_rreg(struct radeon_device *rdev, uint32_t reg) static inline uint32_t r100_mm_rreg(struct radeon_device *rdev, uint32_t reg)
{ {
if (reg < rdev->rmmio_size) if (reg < rdev->rmmio_size)
return readl(((void __iomem *)rdev->rmmio) + reg); return readl((rdev->rmmio) + reg);
else { else {
writel(reg, ((void __iomem *)rdev->rmmio) + RADEON_MM_INDEX); writel(reg, (rdev->rmmio) + RADEON_MM_INDEX);
return readl(((void __iomem *)rdev->rmmio) + RADEON_MM_DATA); return readl((rdev->rmmio) + RADEON_MM_DATA);
} }
} }
static inline void r100_mm_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v) static inline void r100_mm_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
{ {
if (reg < rdev->rmmio_size) if (reg < rdev->rmmio_size)
writel(v, ((void __iomem *)rdev->rmmio) + reg); writel(v, (rdev->rmmio) + reg);
else { else {
writel(reg, ((void __iomem *)rdev->rmmio) + RADEON_MM_INDEX); writel(reg, (rdev->rmmio) + RADEON_MM_INDEX);
writel(v, ((void __iomem *)rdev->rmmio) + RADEON_MM_DATA); writel(v, (rdev->rmmio) + RADEON_MM_DATA);
} }
} }
...@@ -1299,10 +1299,10 @@ static inline void r100_io_wreg(struct radeon_device *rdev, u32 reg, u32 v) ...@@ -1299,10 +1299,10 @@ static inline void r100_io_wreg(struct radeon_device *rdev, u32 reg, u32 v)
/* /*
* Registers read & write functions. * Registers read & write functions.
*/ */
#define RREG8(reg) readb(((void __iomem *)rdev->rmmio) + (reg)) #define RREG8(reg) readb((rdev->rmmio) + (reg))
#define WREG8(reg, v) writeb(v, ((void __iomem *)rdev->rmmio) + (reg)) #define WREG8(reg, v) writeb(v, (rdev->rmmio) + (reg))
#define RREG16(reg) readw(((void __iomem *)rdev->rmmio) + (reg)) #define RREG16(reg) readw((rdev->rmmio) + (reg))
#define WREG16(reg, v) writew(v, ((void __iomem *)rdev->rmmio) + (reg)) #define WREG16(reg, v) writew(v, (rdev->rmmio) + (reg))
#define RREG32(reg) r100_mm_rreg(rdev, (reg)) #define RREG32(reg) r100_mm_rreg(rdev, (reg))
#define DREG32(reg) printk(KERN_INFO "REGISTER: " #reg " : 0x%08X\n", r100_mm_rreg(rdev, (reg))) #define DREG32(reg) printk(KERN_INFO "REGISTER: " #reg " : 0x%08X\n", r100_mm_rreg(rdev, (reg)))
#define WREG32(reg, v) r100_mm_wreg(rdev, (reg), (v)) #define WREG32(reg, v) r100_mm_wreg(rdev, (reg), (v))
......
...@@ -530,7 +530,7 @@ int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) ...@@ -530,7 +530,7 @@ int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr)
addr = addr & 0xFFFFFFFFFFFFF000ULL; addr = addr & 0xFFFFFFFFFFFFF000ULL;
addr |= R600_PTE_VALID | R600_PTE_SYSTEM | R600_PTE_SNOOPED; addr |= R600_PTE_VALID | R600_PTE_SYSTEM | R600_PTE_SNOOPED;
addr |= R600_PTE_READABLE | R600_PTE_WRITEABLE; addr |= R600_PTE_READABLE | R600_PTE_WRITEABLE;
writeq(addr, ((void __iomem *)ptr) + (i * 8)); writeq(addr, ptr + (i * 8));
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册