Fix a compiler warning about varibles being used without being set.
Add some const qualifiers. Remove some "ugly" space around parenthesis.
This commit is contained in:
parent
72ac20c0e8
commit
1f91b5726c
|
@ -1904,20 +1904,26 @@ busTypeSpecific( EntityPtr pEnt, xf86AccessPtr *acc_mem,
|
||||||
*acc_mem = *acc_io = *acc_mem_io = &AccessNULL;
|
*acc_mem = *acc_io = *acc_mem_io = &AccessNULL;
|
||||||
break;
|
break;
|
||||||
case BUS_PCI: {
|
case BUS_PCI: {
|
||||||
struct pci_device * dev =
|
struct pci_device * const dev =
|
||||||
pci_device_find_by_slot( PCI_DOM_FROM_BUS( pEnt->pciBusId.bus ),
|
pci_device_find_by_slot( PCI_DOM_FROM_BUS( pEnt->pciBusId.bus ),
|
||||||
PCI_BUS_NO_DOMAIN( pEnt->pciBusId.bus ),
|
PCI_BUS_NO_DOMAIN( pEnt->pciBusId.bus ),
|
||||||
pEnt->pciBusId.device,
|
pEnt->pciBusId.device,
|
||||||
pEnt->pciBusId.func );
|
pEnt->pciBusId.func );
|
||||||
|
|
||||||
if ( dev != NULL ) {
|
if ((dev != NULL) && ((void *)dev->user_data != NULL)) {
|
||||||
pciAccPtr paccp = (pciAccPtr) dev->user_data;
|
pciAccPtr const paccp = (pciAccPtr) dev->user_data;
|
||||||
|
|
||||||
if ( paccp != NULL ) {
|
|
||||||
*acc_io = & paccp->ioAccess;
|
*acc_io = & paccp->ioAccess;
|
||||||
*acc_mem = & paccp->memAccess;
|
*acc_mem = & paccp->memAccess;
|
||||||
*acc_mem_io = & paccp->io_memAccess;
|
*acc_mem_io = & paccp->io_memAccess;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
/* FIXME: This is an error path. We should probably have an
|
||||||
|
* FIXME: assertion here or something.
|
||||||
|
*/
|
||||||
|
*acc_io = NULL;
|
||||||
|
*acc_mem = NULL;
|
||||||
|
*acc_mem_io = NULL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue