From: Alex Deucher <alexdeucher@gmail.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: xorg-driver-ati@lists.x.org, dri-devel@lists.freedesktop.org,
"Cédric Cano" <ccano@interfaceconcept.com>
Subject: Re: [PATCH 1/6] drm/radeon: Remove a bunch of useless _iomem casts
Date: Wed, 13 Jul 2011 10:33:29 -0400 [thread overview]
Message-ID: <CADnq5_PRsMWg8+tjUsmE+NRRN2969g=fNVirjo=o4=V7VjwSdw@mail.gmail.com> (raw)
In-Reply-To: <1310538492.4968.91.camel@pasglop>
On Wed, Jul 13, 2011 at 2:28 AM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> 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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>
> (resent adding dri-devel to the CC list to hit patchwork)
>
> drivers/gpu/drm/radeon/radeon.h | 22 +++++++++++-----------
> drivers/gpu/drm/radeon/rs600.c | 2 +-
> 2 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
> index ef0e0e0..c92cf2c 100644
> --- a/drivers/gpu/drm/radeon/radeon.h
> +++ b/drivers/gpu/drm/radeon/radeon.h
> @@ -1174,7 +1174,7 @@ struct radeon_device {
> /* Register mmio */
> resource_size_t rmmio_base;
> resource_size_t rmmio_size;
> - void *rmmio;
> + void __iomem *rmmio;
> radeon_rreg_t mc_rreg;
> radeon_wreg_t mc_wreg;
> radeon_rreg_t pll_rreg;
> @@ -1251,20 +1251,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)
> {
> if (reg < rdev->rmmio_size)
> - return readl(((void __iomem *)rdev->rmmio) + reg);
> + return readl((rdev->rmmio) + reg);
> else {
> - writel(reg, ((void __iomem *)rdev->rmmio) + RADEON_MM_INDEX);
> - return readl(((void __iomem *)rdev->rmmio) + RADEON_MM_DATA);
> + writel(reg, (rdev->rmmio) + RADEON_MM_INDEX);
> + return readl((rdev->rmmio) + RADEON_MM_DATA);
> }
> }
>
> static inline void r100_mm_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
> {
> if (reg < rdev->rmmio_size)
> - writel(v, ((void __iomem *)rdev->rmmio) + reg);
> + writel(v, (rdev->rmmio) + reg);
> else {
> - writel(reg, ((void __iomem *)rdev->rmmio) + RADEON_MM_INDEX);
> - writel(v, ((void __iomem *)rdev->rmmio) + RADEON_MM_DATA);
> + writel(reg, (rdev->rmmio) + RADEON_MM_INDEX);
> + writel(v, (rdev->rmmio) + RADEON_MM_DATA);
> }
> }
>
> @@ -1296,10 +1296,10 @@ static inline void r100_io_wreg(struct radeon_device *rdev, u32 reg, u32 v)
> /*
> * Registers read & write functions.
> */
> -#define RREG8(reg) readb(((void __iomem *)rdev->rmmio) + (reg))
> -#define WREG8(reg, v) writeb(v, ((void __iomem *)rdev->rmmio) + (reg))
> -#define RREG16(reg) readw(((void __iomem *)rdev->rmmio) + (reg))
> -#define WREG16(reg, v) writew(v, ((void __iomem *)rdev->rmmio) + (reg))
> +#define RREG8(reg) readb((rdev->rmmio) + (reg))
> +#define WREG8(reg, v) writeb(v, (rdev->rmmio) + (reg))
> +#define RREG16(reg) readw((rdev->rmmio) + (reg))
> +#define WREG16(reg, v) writew(v, (rdev->rmmio) + (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 WREG32(reg, v) r100_mm_wreg(rdev, (reg), (v))
> diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
> index 6e3b11e..6779576 100644
> --- a/drivers/gpu/drm/radeon/rs600.c
> +++ b/drivers/gpu/drm/radeon/rs600.c
> @@ -530,7 +530,7 @@ int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr)
> addr = addr & 0xFFFFFFFFFFFFF000ULL;
> addr |= R600_PTE_VALID | R600_PTE_SYSTEM | R600_PTE_SNOOPED;
> addr |= R600_PTE_READABLE | R600_PTE_WRITEABLE;
> - writeq(addr, ((void __iomem *)ptr) + (i * 8));
> + writeq(addr, ptr + (i * 8));
> return 0;
> }
>
>
>
>
>
prev parent reply other threads:[~2011-07-13 14:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-13 6:28 [PATCH 1/6] drm/radeon: Remove a bunch of useless _iomem casts Benjamin Herrenschmidt
2011-07-13 14:33 ` Alex Deucher [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADnq5_PRsMWg8+tjUsmE+NRRN2969g=fNVirjo=o4=V7VjwSdw@mail.gmail.com' \
--to=alexdeucher@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=ccano@interfaceconcept.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=xorg-driver-ati@lists.x.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.