From 0e7f6c0726e5ff08eeab8e17a5aa63fbe44b3410 Mon Sep 17 00:00:00 2001 From: Kevin E Martin Date: Fri, 6 Apr 2001 17:53:32 +0000 Subject: - Fix typo - Clean up some macros --- linux/r128_drv.h | 40 ++++++++++++++++++++++++++-------------- linux/radeon_drv.h | 23 ++++++++++++++--------- 2 files changed, 40 insertions(+), 23 deletions(-) diff --git a/linux/r128_drv.h b/linux/r128_drv.h index fbc69229..0ef94e45 100644 --- a/linux/r128_drv.h +++ b/linux/r128_drv.h @@ -385,36 +385,48 @@ extern int r128_cce_indirect( struct inode *inode, struct file *filp, #define R128_DEREF(reg) *(volatile u32 *)R128_ADDR( reg ) #ifdef __alpha__ -#define R128_READ(reg) (_R128_READ((u32 *)R128_ADDR(reg))) -static inline u32 _R128_READ(u32 *addr) { - mb(); - return *(volatile u32 *)addr; +#define R128_READ(reg) (_R128_READ((u32 *)R128_ADDR(reg))) +static inline u32 _R128_READ(u32 *addr) +{ + mb(); + return *(volatile u32 *)addr; } -#define R128_WRITE(reg,val) \ - do { wmb(); R128_DEREF(reg) = val; } while (0) +#define R128_WRITE(reg,val) \ +do { \ + wmb(); \ + R128_DEREF(reg) = val; \ +} while (0) #else #define R128_READ(reg) le32_to_cpu( R128_DEREF( reg ) ) -#define R128_WRITE(reg,val) do { R128_DEREF( reg ) = cpu_to_le32( val ); } while (0) +#define R128_WRITE(reg,val) \ +do { \ + R128_DEREF( reg ) = cpu_to_le32( val ); \ +} while (0) #endif #define R128_DEREF8(reg) *(volatile u8 *)R128_ADDR( reg ) #ifdef __alpha__ #define R128_READ8(reg) _R128_READ8((u8 *)R128_ADDR(reg)) -static inline u8 _R128_READ8(u8 *addr) { +static inline u8 _R128_READ8(u8 *addr) +{ mb(); return *(volatile u8 *)addr; } -#define R128_WRITE8(reg,val) \ - do { wmb(); R128_DEREF8(reg) = val; } while (0) +#define R128_WRITE8(reg,val) \ +do { \ + wmb(); \ + R128_DEREF8(reg) = val; \ +} while (0) #else #define R128_READ8(reg) R128_DEREF8( reg ) #define R128_WRITE8(reg,val) do { R128_DEREF8( reg ) = val; } while (0) #endif -#define R128_WRITE_PLL(addr,val) \ -do { \ - R128_WRITE8(R128_CLOCK_CNTL_INDEX, ((addr) & 0x1f) | R128_PLL_WR_EN); \ - R128_WRITE(R128_CLOCK_CNTL_DATA, (val)); \ +#define R128_WRITE_PLL(addr,val) \ +do { \ + R128_WRITE8(R128_CLOCK_CNTL_INDEX, \ + ((addr) & 0x1f) | R128_PLL_WR_EN); \ + R128_WRITE(R128_CLOCK_CNTL_DATA, (val)); \ } while (0) extern int R128_READ_PLL(drm_device_t *dev, int addr); diff --git a/linux/radeon_drv.h b/linux/radeon_drv.h index 24935847..ee5e113b 100644 --- a/linux/radeon_drv.h +++ b/linux/radeon_drv.h @@ -521,13 +521,15 @@ extern int radeon_cp_indirect( struct inode *inode, struct file *filp, #define RADEON_DEREF(reg) *(volatile u32 *)RADEON_ADDR( reg ) #ifdef __alpha__ #define RADEON_READ(reg) (_RADEON_READ((u32 *)RADEON_ADDR( reg ))) -static inline u32 _RADEON_READ(u32 *addr) { +static inline u32 _RADEON_READ(u32 *addr) +{ mb(); return *(volatile u32 *)addr; } -#define RADEON_WRITE(reg,val) do { \ - wmb(); - RADEON_DEREF(reg) = val; +#define RADEON_WRITE(reg,val) \ +do { \ + wmb(); \ + RADEON_DEREF(reg) = val; \ } while (0) #else #define RADEON_READ(reg) RADEON_DEREF( reg ) @@ -537,20 +539,23 @@ static inline u32 _RADEON_READ(u32 *addr) { #define RADEON_DEREF8(reg) *(volatile u8 *)RADEON_ADDR( reg ) #ifdef __alpha__ #define RADEON_READ8(reg) _RADEON_READ8((u8 *)RADEON_ADDR( reg )) -static inline u8 _RADEON_READ8(u8 *addr) { +static inline u8 _RADEON_READ8(u8 *addr) +{ mb(); return *(volatile u8 *)addr; } -#define RADEON_WRITE8(reg,val) do { \ - wmb(); - RADEON_DEREF8( reg ) = val; +#define RADEON_WRITE8(reg,val) \ +do { \ + wmb(); \ + RADEON_DEREF8( reg ) = val; \ } while (0) #else #define RADEON_READ8(reg) RADEON_DEREF8( reg ) #define RADEON_WRITE8(reg, val) do { RADEON_DEREF8( reg ) = val; } while (0) #endif -#define RADEON_WRITE_PLL( addr, val ) do { \ +#define RADEON_WRITE_PLL( addr, val ) \ +do { \ RADEON_WRITE8( RADEON_CLOCK_CNTL_INDEX, \ ((addr) & 0x1f) | RADEON_PLL_WR_EN ); \ RADEON_WRITE( RADEON_CLOCK_CNTL_DATA, (val) ); \ -- cgit v1.2.3