[PATCH i-g-t 08/10] intel_vga_{read, write}: use INREG and OUTREG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use INREG and OUTREG instead of using mmio directly.

Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
---
 tools/intel_vga_read.c  | 2 +-
 tools/intel_vga_write.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/intel_vga_read.c b/tools/intel_vga_read.c
index e635c59cda3b..ea5070577a1e 100644
--- a/tools/intel_vga_read.c
+++ b/tools/intel_vga_read.c
@@ -37,7 +37,7 @@
 static uint8_t read_reg(uint32_t reg, bool use_mmio)
 {
 	if (use_mmio)
-		return *((volatile uint8_t *)mmio + reg);
+		return INREG8(reg);
 	else
 		return inb(reg);
 }
diff --git a/tools/intel_vga_write.c b/tools/intel_vga_write.c
index 4fb09d6a247a..821596246a2a 100644
--- a/tools/intel_vga_write.c
+++ b/tools/intel_vga_write.c
@@ -37,7 +37,7 @@
 static void write_reg(uint32_t reg, uint8_t val, bool use_mmio)
 {
 	if (use_mmio)
-		*((volatile uint8_t *)mmio + reg) = val;
+		OUTREG8(reg, val);
 	else
 		outb(val, reg);
 }
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux