Index: programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c,v retrieving revision 1.7 diff -u -r1.7 lnx_pci.c --- programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c 3 Jul 2005 08:53:46 -0000 1.7 +++ programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c 17 Aug 2005 04:16:25 -0000 @@ -164,7 +164,7 @@ unsigned int ndx; if (!(file = fopen("/proc/bus/pci/devices","r"))) - return NULL; + return 0; do { res = fgets(c,0x1ff,file); if (res) { @@ -192,7 +192,7 @@ &size[3], &size[4], &size[5], &size[6]); if (num != 16) { /* apparantly not 2.3 style */ fclose(file); - return NULL; + return 0; } dev = devfn >> 3; @@ -211,10 +211,11 @@ else /* this the ROM bar */ savePtr = (0xFFFFFFF0) & pciReadLong(tag, PCI_CMD_BASE_REG + (0x4 * ndx)); + /* find the index of the incoming base */ if (base >= savePtr && base <= (savePtr + size[ndx])) { fclose(file); - return ( ~(0xFUL) & (offset[ndx] + (base - savePtr))); + return (offset[ndx] & ~(0xFUL)) + (base - savePtr); } } } @@ -222,6 +223,6 @@ } while (res); fclose(file); - return NULL; + return 0; }