Bus: Delete some obfuscatory macros

This commit is contained in:
Adam Jackson 2009-01-26 06:23:09 -05:00
parent 8eca37cb89
commit 9ff6180161
6 changed files with 17 additions and 23 deletions

View File

@ -218,13 +218,13 @@ xf86IsEntityPrimary(int entityIndex)
{
EntityPtr pEnt = xf86Entities[entityIndex];
if (primaryBus.type != pEnt->busType) return FALSE;
if (primaryBus.type != pEnt->bus.type) return FALSE;
switch (pEnt->busType) {
switch (pEnt->bus.type) {
case BUS_PCI:
return (pEnt->bus.id.pci == primaryBus.id.pci);
case BUS_SBUS:
return (pEnt->sbusBusId.fbNum == primaryBus.id.sbus.fbNum);
return (pEnt->bus.id.sbus.fbNum == primaryBus.id.sbus.fbNum);
default:
return FALSE;
}
@ -1000,9 +1000,9 @@ needCheck(resPtr pRes, unsigned long type, int entityIndex, xf86State state)
}
if (entityIndex > -1)
loc = xf86Entities[entityIndex]->busType;
loc = xf86Entities[entityIndex]->bus.type;
if (pRes->entityIndex > -1)
r_loc = xf86Entities[pRes->entityIndex]->busType;
r_loc = xf86Entities[pRes->entityIndex]->bus.type;
if ((type & ResAccMask) == ResShared &&
(pRes->res_type & ResAccMask) == ResShared)
@ -1295,7 +1295,7 @@ static void
convertRange2Host(int entityIndex, resRange *pRange)
{
if (pRange->type & ResBus) {
switch (xf86Entities[entityIndex]->busType) {
switch (xf86Entities[entityIndex]->bus.type) {
case BUS_PCI:
pciConvertRange2Host(entityIndex,pRange);
break;

View File

@ -89,10 +89,6 @@ typedef struct {
#define NEED_SHARED (NEED_MEM_SHARED | NEED_IO_SHARED)
#define busType bus.type
#define isaBusId bus.id.isa
#define sbusBusId bus.id.sbus
struct x_BusAccRec;
typedef void (*BusAccProcPtr)(struct x_BusAccRec *ptr);

View File

@ -483,7 +483,7 @@ probe_devices_from_device_sections(DriverPtr drvp)
for ( k = 0; k < xf86NumEntities; k++ ) {
EntityPtr pEnt = xf86Entities[k];
if (pEnt->busType != BUS_PCI)
if (pEnt->bus.type != BUS_PCI)
continue;
if (pEnt->bus.id.pci == pPci) {

View File

@ -1,4 +1,3 @@
/*
* Copyright (c) 2000-2001 by The XFree86 Project, Inc.
*
@ -63,7 +62,7 @@ xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
p = xf86Entities[num];
p->driver = drvp;
p->chipset = 0;
p->busType = BUS_NONE;
p->bus.type = BUS_NONE;
p->active = active;
p->inUse = FALSE;
xf86AddDevToEntity(num, dev);
@ -88,7 +87,7 @@ xf86GetFbInfoForScreen(int scrnIndex)
for (i = 0; i < xf86Screens[scrnIndex]->numEntities; i++) {
p = xf86Entities[xf86Screens[scrnIndex]->entityList[i]];
if (p->busType == BUS_NONE) {
if (p->bus.type == BUS_NONE) {
num++;
}
}

View File

@ -1,4 +1,3 @@
/*
* Copyright (c) 2000-2002 by The XFree86 Project, Inc.
*
@ -61,7 +60,7 @@ xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
p = xf86Entities[num];
p->driver = drvp;
p->chipset = 0;
p->busType = BUS_NONE;
p->bus.type = BUS_NONE;
p->active = active;
p->inUse = FALSE;
xf86AddDevToEntity(num, dev);

View File

@ -320,7 +320,7 @@ xf86CheckSbusSlot(int fbNum)
for (i = 0; i < xf86NumEntities; i++) {
p = xf86Entities[i];
/* Check if this SBUS slot is taken */
if (p->busType == BUS_SBUS && p->sbusBusId.fbNum == fbNum)
if (p->bus.type == BUS_SBUS && p->bus.id.sbus.fbNum == fbNum)
return FALSE;
}
@ -345,9 +345,9 @@ xf86ClaimSbusSlot(sbusDevicePtr psdp, DriverPtr drvp,
p = xf86Entities[num];
p->driver = drvp;
p->chipset = -1;
p->busType = BUS_SBUS;
p->bus.type = BUS_SBUS;
xf86AddDevToEntity(num, dev);
p->sbusBusId.fbNum = psdp->fbNum;
p->bus.id.sbus.fbNum = psdp->fbNum;
p->active = active;
p->inUse = FALSE;
/* Here we initialize the access structure */
@ -543,10 +543,10 @@ xf86GetSbusInfoForEntity(int entityIndex)
EntityPtr p = xf86Entities[entityIndex];
if (entityIndex >= xf86NumEntities
|| p->busType != BUS_SBUS) return NULL;
|| p->bus.type != BUS_SBUS) return NULL;
for (psdpp = xf86SbusInfo; *psdpp != NULL; psdpp++) {
if (p->sbusBusId.fbNum == (*psdpp)->fbNum)
if (p->bus.id.sbus.fbNum == (*psdpp)->fbNum)
return (*psdpp);
}
return NULL;
@ -559,9 +559,9 @@ xf86GetEntityForSbusInfo(sbusDevicePtr psdp)
for (i = 0; i < xf86NumEntities; i++) {
EntityPtr p = xf86Entities[i];
if (p->busType != BUS_SBUS) continue;
if (p->bus.type != BUS_SBUS) continue;
if (p->sbusBusId.fbNum == psdp->fbNum)
if (p->bus.id.sbus.fbNum == psdp->fbNum)
return i;
}
return -1;