public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Mrzyglod <daniel.t.mrzyglod@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>, Daniel Vetter <daniel@ffwll.ch>
Subject: [igt-dev] [PATCH i-g-t v9 2/4] lib/intel_mmio: fix unnecessary casting in R/W register functions
Date: Tue, 27 Aug 2019 17:25:02 +0200	[thread overview]
Message-ID: <20190827152504.7491-3-daniel.t.mrzyglod@intel.com> (raw)
In-Reply-To: <20190827152504.7491-1-daniel.t.mrzyglod@intel.com>

This patch remove cast (volatile char *) becouse we allow arithmetic on
void pointer.

Cc: Michal Winiarski <michal.winiarski@intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Daniele Spurio Ceraolo <daniele.ceraolospurio@intel.com>
Cc: Katarzyna Dec <katarzyna.dec@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

Signed-off-by: Daniel Mrzyglod <daniel.t.mrzyglod@intel.com>
---
 lib/intel_mmio.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/intel_mmio.c b/lib/intel_mmio.c
index a5458aeb..0d858f91 100644
--- a/lib/intel_mmio.c
+++ b/lib/intel_mmio.c
@@ -266,7 +266,7 @@ intel_register_read(uint32_t reg)
 	}
 
 read_out:
-	ret = *(volatile uint32_t *)((volatile char *)igt_global_mmio + reg);
+	ret = *(volatile uint32_t *)(igt_global_mmio + reg);
 out:
 	return ret;
 }
@@ -303,7 +303,7 @@ intel_register_write(uint32_t reg, uint32_t val)
 		      "Register write blocked for safety ""(*0x%08x = 0x%x)\n", reg, val);
 
 write_out:
-	*(volatile uint32_t *)((volatile char *)igt_global_mmio + reg) = val;
+	*(volatile uint32_t *)(igt_global_mmio + reg) = val;
 }
 
 
@@ -321,7 +321,7 @@ write_out:
  */
 uint32_t INREG(uint32_t reg)
 {
-	return *(volatile uint32_t *)((volatile char *)igt_global_mmio + reg);
+	return *(volatile uint32_t *)(igt_global_mmio + reg);
 }
 
 /**
@@ -338,7 +338,7 @@ uint32_t INREG(uint32_t reg)
  */
 uint16_t INREG16(uint32_t reg)
 {
-	return *(volatile uint16_t *)((volatile char *)igt_global_mmio + reg);
+	return *(volatile uint16_t *)(igt_global_mmio + reg);
 }
 
 /**
@@ -371,7 +371,7 @@ uint8_t INREG8(uint32_t reg)
  */
 void OUTREG(uint32_t reg, uint32_t val)
 {
-	*(volatile uint32_t *)((volatile char *)igt_global_mmio + reg) = val;
+	*(volatile uint32_t *)(igt_global_mmio + reg) = val;
 }
 
 /**
@@ -387,7 +387,7 @@ void OUTREG(uint32_t reg, uint32_t val)
  */
 void OUTREG16(uint32_t reg, uint16_t val)
 {
-	*(volatile uint16_t *)((volatile char *)igt_global_mmio + reg) = val;
+	*(volatile uint16_t *)(igt_global_mmio + reg) = val;
 }
 
 /**
-- 
2.21.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-08-27 15:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27 15:25 [igt-dev] [PATCH i-g-t v9 0/4] Remove global igt_global_mmio Daniel Mrzyglod
2019-08-27 15:25 ` [igt-dev] [PATCH i-g-t v9 1/4] lib/igt_device: add igt_device_get_pci_addr by fd Daniel Mrzyglod
2019-08-27 15:25 ` Daniel Mrzyglod [this message]
2019-08-27 15:28   ` [igt-dev] [PATCH i-g-t v9 2/4] lib/intel_mmio: fix unnecessary casting in R/W register functions Chris Wilson
2019-08-27 15:25 ` [igt-dev] [PATCH i-g-t v9 3/4] lib/intel_mmio: add funtions for read/write register funtions Daniel Mrzyglod
2019-08-27 15:31   ` Chris Wilson
2019-08-27 15:32     ` Chris Wilson
2019-08-27 15:25 ` [igt-dev] [PATCH i-g-t v9 4/4] lib/intel_mmio: add additional api for multiple devices Daniel Mrzyglod
2019-08-27 16:07 ` [igt-dev] ✓ Fi.CI.BAT: success for Remove global igt_global_mmio (rev9) Patchwork
2019-08-28 13:51 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

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=20190827152504.7491-3-daniel.t.mrzyglod@intel.com \
    --to=daniel.t.mrzyglod@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox