[ofw] [PATCH] ibbus - remove code for ca_guid == 0
Smith, Stan
stan.smith at intel.com
Fri Jun 10 17:11:12 PDT 2011
Remove code for ca_guid == 0 as the caller bus_pnp.c::fdo_query_bus_relations() skips calling if ca_guid == 0.
Set an ASSERT() to trap a future programming error.
Signed-off-by: stan smith <stan.smith at intel.com>
--- core/bus/kernel/bus_iou_mgr.c Fri Jun 10 16:54:12 2011
+++ core/bus/kernel/bus_iou_mgr.c Fri Jun 10 16:52:49 2011
@@ -532,29 +532,12 @@
NTSTATUS status;
bus_filter_t *p_bfi;
iou_mgr_t *p_iou_mgr;
- DEVICE_RELATIONS *p_rel;
BUS_ENTER( BUS_DBG_PNP );
BUS_PRINT(BUS_DBG_PNP, ("CA_guid %I64x\n",ca_guid));
- /* special case guid == 0 - walk all bus filter instances */
- if ( ca_guid == 0ULL ) {
- for(p_bfi=g_bus_filters; p_bfi < &g_bus_filters[MAX_BUS_FILTERS]; p_bfi++) {
- p_iou_mgr = p_bfi->p_iou_mgr;
- if ( !p_iou_mgr )
- continue;
- cl_mutex_acquire( &p_iou_mgr->pdo_mutex );
- status = bus_get_relations( &p_iou_mgr->iou_list, ca_guid, p_irp );
- cl_mutex_release( &p_iou_mgr->pdo_mutex );
- }
- p_rel = (DEVICE_RELATIONS*)p_irp->IoStatus.Information;
- if ( p_rel ) {
- BUS_PRINT(BUS_DBG_PNP, ("CA_guid 0 Reports %d relations\n", p_rel->Count));
- }
- BUS_EXIT( BUS_DBG_PNP );
- return STATUS_SUCCESS;
- }
+ CL_ASSERT( ca_guid != 0ULL );
p_bfi = get_bfi_by_ca_guid(ca_guid);
if (p_bfi == NULL) {
--- core/bus/kernel/bus_port_mgr.c Fri Jun 10 17:03:12 2011
+++ core/bus/kernel/bus_port_mgr.c Fri Jun 10 16:53:49 2011
@@ -526,33 +526,12 @@
NTSTATUS status;
bus_filter_t *p_bfi;
port_mgr_t *p_port_mgr;
- DEVICE_RELATIONS *p_rel;
BUS_ENTER( BUS_DBG_PNP );
BUS_PRINT(BUS_DBG_PNP, ("CA_guid %I64x\n",ca_guid));
- /* special case guid == 0 - walk all bus filter instances */
- if ( ca_guid == 0ULL ) {
- BUS_PRINT(BUS_DBG_PNP, ("CA_guid 0\n"));
- for(p_bfi=g_bus_filters; p_bfi < &g_bus_filters[MAX_BUS_FILTERS]; p_bfi++) {
- p_port_mgr = p_bfi->p_port_mgr;
- if ( !p_port_mgr )
- continue;
- cl_mutex_acquire( &p_port_mgr->pdo_mutex );
- status = bus_get_relations( &p_port_mgr->port_list,
- p_bfi->ca_guid,
- p_irp );
- cl_mutex_release( &p_port_mgr->pdo_mutex );
- }
-
- p_rel = (DEVICE_RELATIONS*)p_irp->IoStatus.Information;
- if ( p_rel ) {
- BUS_PRINT(BUS_DBG_PNP, ("CA_guid 0 Reports %d\n", p_rel->Count));
- }
- BUS_EXIT( BUS_DBG_PNP );
- return STATUS_SUCCESS;
- }
+ CL_ASSERT( ca_guid != 0ULL );
p_bfi = get_bfi_by_ca_guid(ca_guid);
if (p_bfi == NULL) {
More information about the ofw
mailing list