[PATCH 12/14] xfree86: IOADDRESS is PCIism and shouldn't be used by common header files

Mark Kettenis mark.kettenis at xs4all.nl
Tue Jun 1 08:50:17 PDT 2010


> From: Tiago Vignatti <tiago.vignatti at nokia.com>
> Date: Tue,  1 Jun 2010 17:59:08 +0300

This change does not make it easier to understand the code.  Imagine
someone looking at it after you apply this diff.  What is the meaning
of 'vertsyncreg'?  

Really, if the type is a PCIism, so are the variables that are
declared using that type.  That may be undesirable, but at least the
use of IOADDRESS as a type makes that clear.

>  hw/xfree86/common/xf86.h       |    2 +-
>  hw/xfree86/common/xf86Bus.h    |    2 +-
>  hw/xfree86/common/xf86Helper.c |    2 +-
>  hw/xfree86/common/xf86str.h    |    2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
> index d8629a8..755d171 100644
> --- a/hw/xfree86/common/xf86.h
> +++ b/hw/xfree86/common/xf86.h
> @@ -240,7 +240,7 @@ extern _X_EXPORT void xf86GetClocks(ScrnInfoPtr pScrn, int num,
>  		   Bool (*ClockFunc)(ScrnInfoPtr, int),
>  		   void (*ProtectRegs)(ScrnInfoPtr, Bool),
>  		   void (*BlankScreen)(ScrnInfoPtr, Bool),
> -		   IOADDRESS vertsyncreg, int maskval,
> +		   unsigned long vertsyncreg, int maskval,
>  		   int knownclkindex, int knownclkvalue);
>  extern _X_EXPORT const char *xf86GetVisualName(int visual);
>  extern _X_EXPORT int xf86GetVerbosity(void);
> diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h
> index e161c7f..2f46ef4 100644
> --- a/hw/xfree86/common/xf86Bus.h
> +++ b/hw/xfree86/common/xf86Bus.h
> @@ -58,7 +58,7 @@ typedef struct {
>      DevUnion *                  entityPrivates;
>      int                         numInstances;
>      GDevPtr *                   devices;   
> -    IOADDRESS                   domainIO;
> +    unsigned long               domainIO;
>  } EntityRec, *EntityPtr;
>  
>  #define ACCEL_IS_SHARABLE 0x100
> diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
> index bde80ea..00fb756 100644
> --- a/hw/xfree86/common/xf86Helper.c
> +++ b/hw/xfree86/common/xf86Helper.c
> @@ -1506,7 +1506,7 @@ xf86MatchDevice(const char *drivername, GDevPtr **sectlist)
>  void
>  xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int),
>  	      void (*ProtectRegs)(ScrnInfoPtr, Bool),
> -	      void (*BlankScreen)(ScrnInfoPtr, Bool), IOADDRESS vertsyncreg,
> +	      void (*BlankScreen)(ScrnInfoPtr, Bool), unsigned long vertsyncreg,
>  	      int maskval, int knownclkindex, int knownclkvalue)
>  {
>      register int status = vertsyncreg;
> diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
> index d87baf9..6bf5945 100644
> --- a/hw/xfree86/common/xf86str.h
> +++ b/hw/xfree86/common/xf86str.h
> @@ -753,7 +753,7 @@ typedef struct _ScrnInfoRec {
>      unsigned long	biosBase;		/* Base address of video BIOS */
>      unsigned long	memPhysBase;		/* Physical address of FB */
>      unsigned long 	fbOffset;		/* Offset of FB in the above */
> -    IOADDRESS    	domainIOBase;		/* Domain I/O base address */
> +    unsigned long	domainIOBase;		/* Domain I/O base address */
>      int			memClk;			/* memory clock */
>      int			textClockFreq;		/* clock of text mode */
>      Bool		flipPixels;		/* swap default black/white */


More information about the xorg-devel mailing list