From fc3678a6c0ee4eb59244a5ba2da58ca47fd20501 Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Thu, 17 Jun 2010 13:10:44 -0400 Subject: [PATCH] Staging: xgifb: Remove PUSHORT, PLONGU, and PVOID typedefs Signed-off-by: Bill Pemberton Cc: Arnaud Patard Signed-off-by: Greg Kroah-Hartman --- drivers/staging/xgifb/vb_init.c | 70 +++++++++++++++--------------- drivers/staging/xgifb/vb_setmode.c | 4 +- drivers/staging/xgifb/vgatypes.h | 14 +----- 3 files changed, 38 insertions(+), 50 deletions(-) diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c index 7d4beda828d3..04e6f6ef922e 100644 --- a/drivers/staging/xgifb/vb_init.c +++ b/drivers/staging/xgifb/vb_init.c @@ -1619,9 +1619,9 @@ void XGINew_SetDRAMSizingType( int index , USHORT DRAMTYPE_TABLE[][ 5 ] ,PVB_DEV void XGINew_CheckBusWidth_310( PVB_DEVICE_INFO pVBInfo) { USHORT data ; - PULONG volatile pVideoMemory ; + volatile unsigned long *pVideoMemory ; - pVideoMemory = (PULONG) pVBInfo->FBAddr; + pVideoMemory = (unsigned long *) pVBInfo->FBAddr; if ( XGINew_Get310DRAMType( pVBInfo ) < 2 ) { @@ -1832,17 +1832,17 @@ int XGINew_CheckColumn( int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INF for( i = 0 , Position = 0 ; i < 2 ; i++ ) { - *( ( PULONG )( pVBInfo->FBAddr + Position ) ) = Position ; - Position += Increment ; + *((unsigned long *)(pVBInfo->FBAddr + Position)) = Position; + Position += Increment ; } for( i = 0 , Position = 0 ; i < 2 ; i++ ) { /* if ( pVBInfo->FBAddr[ Position ] != Position ) */ - if ( ( *( PULONG )( pVBInfo->FBAddr + Position ) ) != Position ) - return( 0 ) ; - Position += Increment ; + if ((*(unsigned long *)(pVBInfo->FBAddr + Position)) != Position) + return 0; + Position += Increment; } return( 1 ) ; } @@ -1864,16 +1864,16 @@ int XGINew_CheckBanks( int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO for( i = 0 , Position = 0 ; i < 4 ; i++ ) { /* pVBInfo->FBAddr[ Position ] = Position ; */ - *( ( PULONG )( pVBInfo->FBAddr + Position ) ) = Position ; - Position += Increment ; + *((unsigned long *)(pVBInfo->FBAddr + Position)) = Position; + Position += Increment ; } for( i = 0 , Position = 0 ; i < 4 ; i++ ) { /* if (pVBInfo->FBAddr[ Position ] != Position ) */ - if ( ( *( PULONG )( pVBInfo->FBAddr + Position ) ) != Position ) - return( 0 ) ; - Position += Increment ; + if ((*(unsigned long *)(pVBInfo->FBAddr + Position)) != Position) + return 0; + Position += Increment; } return( 1 ) ; } @@ -1896,18 +1896,18 @@ int XGINew_CheckRank( int RankNo , int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB for( i = 0 , Position = 0 ; i < 2 ; i++ ) { /* pVBInfo->FBAddr[ Position ] = Position ; */ - /* *( ( PULONG )( pVBInfo->FBAddr ) ) = Position ; */ - *( ( PULONG )( pVBInfo->FBAddr + Position ) ) = Position ; - Position += Increment ; + /* *( (unsigned long *)( pVBInfo->FBAddr ) ) = Position ; */ + *((unsigned long *)(pVBInfo->FBAddr + Position)) = Position; + Position += Increment; } for( i = 0 , Position = 0 ; i < 2 ; i++ ) { /* if ( pVBInfo->FBAddr[ Position ] != Position ) */ - /* if ( ( *( PULONG )( pVBInfo->FBAddr ) ) != Position ) */ - if ( ( *( PULONG )( pVBInfo->FBAddr + Position ) ) != Position ) - return( 0 ) ; - Position += Increment ; + /* if ( ( *(unsigned long *)( pVBInfo->FBAddr ) ) != Position ) */ + if ((*(unsigned long *)(pVBInfo->FBAddr + Position)) != Position) + return 0; + Position += Increment; } return( 1 ); } @@ -1930,18 +1930,18 @@ int XGINew_CheckDDRRank( int RankNo , int index , USHORT DRAMTYPE_TABLE[][ 5 ], Increment += Increment / 2 ; Position = 0; - *( ( PULONG )( pVBInfo->FBAddr + Position + 0 ) ) = 0x01234567 ; - *( ( PULONG )( pVBInfo->FBAddr + Position + 1 ) ) = 0x456789AB ; - *( ( PULONG )( pVBInfo->FBAddr + Position + 2 ) ) = 0x55555555 ; - *( ( PULONG )( pVBInfo->FBAddr + Position + 3 ) ) = 0x55555555 ; - *( ( PULONG )( pVBInfo->FBAddr + Position + 4 ) ) = 0xAAAAAAAA ; - *( ( PULONG )( pVBInfo->FBAddr + Position + 5 ) ) = 0xAAAAAAAA ; + *((unsigned long *)(pVBInfo->FBAddr + Position + 0)) = 0x01234567; + *((unsigned long *)(pVBInfo->FBAddr + Position + 1)) = 0x456789AB; + *((unsigned long *)(pVBInfo->FBAddr + Position + 2)) = 0x55555555; + *((unsigned long *)(pVBInfo->FBAddr + Position + 3)) = 0x55555555; + *((unsigned long *)(pVBInfo->FBAddr + Position + 4)) = 0xAAAAAAAA; + *((unsigned long *)(pVBInfo->FBAddr + Position + 5)) = 0xAAAAAAAA; - if ( ( *( PULONG )( pVBInfo->FBAddr + 1 ) ) == 0x456789AB ) - return( 1 ) ; + if ((*(unsigned long *)(pVBInfo->FBAddr + 1)) == 0x456789AB) + return 1; - if ( ( *( PULONG )( pVBInfo->FBAddr + 0 ) ) == 0x01234567 ) - return( 0 ) ; + if ((*(unsigned long *)(pVBInfo->FBAddr + 0)) == 0x01234567) + return 0; data = XGINew_GetReg1( pVBInfo->P3c4 , 0x14 ) ; data &= 0xF3 ; @@ -2147,26 +2147,26 @@ int XGINew_ReadWriteRest( USHORT StopAddr , USHORT StartAddr, PVB_DEVICE_INFO pV int i ; ULONG Position = 0 ; - *( ( PULONG )( pVBInfo->FBAddr + Position ) ) = Position ; + *((unsigned long *)(pVBInfo->FBAddr + Position)) = Position; for( i = StartAddr ; i <= StopAddr ; i++ ) { Position = 1 << i ; - *( ( PULONG )( pVBInfo->FBAddr + Position ) ) = Position ; + *((unsigned long *)(pVBInfo->FBAddr + Position)) = Position; } DelayUS( 500 ) ; /* [Vicent] 2004/04/16. Fix #1759 Memory Size error in Multi-Adapter. */ Position = 0 ; - if ( ( *( PULONG )( pVBInfo->FBAddr + Position ) ) != Position ) - return( 0 ) ; + if ((*(unsigned long *)(pVBInfo->FBAddr + Position)) != Position) + return 0; for( i = StartAddr ; i <= StopAddr ; i++ ) { Position = 1 << i ; - if ( ( *( PULONG )( pVBInfo->FBAddr + Position ) ) != Position ) - return( 0 ) ; + if ((*(unsigned long *)(pVBInfo->FBAddr + Position)) != Position) + return 0; } return( 1 ) ; } diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index a0ccce07f125..662ca77f79e4 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c @@ -2588,9 +2588,9 @@ void XGI_WriteDAC( USHORT dl , USHORT ah , USHORT al , USHORT dh,PVB_DEVICE_INFO /* --------------------------------------------------------------------- */ void XGI_ClearBuffer( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo, PVB_DEVICE_INFO pVBInfo) { - PVOID VideoMemoryAddress = ( PVOID )HwDeviceExtension->pjVideoMemoryAddress ; + void *VideoMemoryAddress = (void *)HwDeviceExtension->pjVideoMemoryAddress; ULONG AdapterMemorySize = ( ULONG )HwDeviceExtension->ulVideoMemorySize ; - PUSHORT pBuffer ; + unsigned short *pBuffer ; int i ; if ( pVBInfo->ModeType >= ModeEGA ) diff --git a/drivers/staging/xgifb/vgatypes.h b/drivers/staging/xgifb/vgatypes.h index ec4c83f7a7c4..0d5472ec9297 100644 --- a/drivers/staging/xgifb/vgatypes.h +++ b/drivers/staging/xgifb/vgatypes.h @@ -28,22 +28,10 @@ typedef unsigned short USHORT; typedef unsigned long ULONG; #endif -#ifndef PUSHORT -typedef USHORT *PUSHORT; -#endif - -#ifndef PLONGU -typedef ULONG *PULONG; -#endif - #ifndef VOID typedef void VOID; #endif -#ifndef PVOID -typedef void *PVOID; -#endif - #ifndef BOOLEAN typedef UCHAR BOOLEAN; #endif @@ -126,7 +114,7 @@ struct _XGI_HW_DEVICE_INFO BOOLEAN UseROM; /* Use the ROM image if provided */ - PVOID pDevice; + void *pDevice; unsigned char *pjVideoMemoryAddress;/* base virtual memory address */ /* of Linear VGA memory */