changeset 33324:8773e8565983

Simplify macros and get rid of incorrect casts from pointers to uint32_t. Fixes also a huge amount of compiler warnings.
author reimar
date Sat, 07 May 2011 19:49:26 +0000
parents d4af28753ec8
children 7cb8dd27fcaa
files vidix/mga_vid.c
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/vidix/mga_vid.c	Sat May 07 19:44:05 2011 +0000
+++ b/vidix/mga_vid.c	Sat May 07 19:49:26 2011 +0000
@@ -67,14 +67,13 @@
 #define ENOTSUP EOPNOTSUPP
 #endif
 
-/* from radeon_vid */
-#define GETREG(TYPE,PTR,OFFZ)		(*((volatile TYPE*)((PTR)+(OFFZ))))
-#define SETREG(TYPE,PTR,OFFZ,VAL)	(*((volatile TYPE*)((PTR)+(OFFZ))))=VAL
+#define GETREG(TYPE,PTR)		(*(volatile TYPE*)(PTR))
+#define SETREG(TYPE,PTR,VAL)		(*(volatile TYPE*)(PTR))=VAL
 
-#define readb(addr)		GETREG(uint8_t,(uint32_t)(addr),0)
-#define writeb(val,addr)	SETREG(uint8_t,(uint32_t)(addr),0,val)
-#define readl(addr)		GETREG(uint32_t,(uint32_t)(addr),0)
-#define writel(val,addr)	SETREG(uint32_t,(uint32_t)(addr),0,val)
+#define readb(addr)		GETREG(uint8_t,addr)
+#define writeb(val,addr)	SETREG(uint8_t,addr,val)
+#define readl(addr)		GETREG(uint32_t,addr)
+#define writel(val,addr)	SETREG(uint32_t,addr,val)
 
 static int mga_verbose = 0;