[ofw] RE: IBBUS - bus_iou_mgr.c - change variable name from gp_iou_mgr to p_iou_mgr

Leonid Keller leonid at mellanox.co.il
Fri May 22 06:59:47 PDT 2009


Go ahead. 

> -----Original Message-----
> From: Smith, Stan [mailto:stan.smith at intel.com] 
> Sent: Thursday, May 21, 2009 8:53 PM
> To: Leonid Keller
> Cc: ofw at lists.openfabrics.org
> Subject: IBBUS - bus_iou_mgr.c - change variable name from 
> gp_iou_mgr to p_iou_mgr
> 
> 
> Hello,
>   The following patch changes the historical 'global' 
> variable name 'gp_iou_mgr' to a local variable name 
> 'p_iou_mgr' to be consistent with MS variable naming 
> conventions and it's local scope.
> 
> There are no functionality changes, just the variable name change.
> 
> The global name was left over from filter driver conversion 
> work; it was not changed at that time to minimize the number 
> of changes when converting to a filter driver.
> 
> I will commit on your approval.
> 
> Once this patch is committed, I'm done with bus driver 
> changes....  :-)
> 
> stan.
> 
> Signed off by stan.smith at intel.com
> 
> 
> diff U3 Z:/Documents and Settings/scsmith/My 
> Documents/openIB-windows/SVN/gen1/trunk/core/bus/kernel/bus_io
> u_mgr.c 
> F:/openIB-windows-svn/latest/gen1/trunk/core/bus/kernel/bus_iou_mgr.c
> --- Z:/Documents and Settings/scsmith/My 
> Documents/openIB-windows/SVN/gen1/trunk/core/bus/kernel/bus_io
> u_mgr.c  Tue May 19 13:07:24 2009
> +++ 
> F:/openIB-windows-svn/latest/gen1/trunk/core/bus/kernel/bus_io
> u_mgr.c       Thu May 21 09:40:44 2009
> @@ -266,44 +266,44 @@
>  {
>         ib_api_status_t         status;
>         cl_status_t                     cl_status;
> -       iou_mgr_t                       *gp_iou_mgr;
> +       iou_mgr_t                       *p_iou_mgr;
> 
>         BUS_ENTER( BUS_DBG_PNP );
> 
>         CL_ASSERT( p_bfi->p_iou_mgr == NULL );
> 
> -       gp_iou_mgr = cl_zalloc( sizeof(iou_mgr_t) );
> -       if( !gp_iou_mgr )
> +       p_iou_mgr = cl_zalloc( sizeof(iou_mgr_t) );
> +       if( !p_iou_mgr )
>         {
>                 BUS_TRACE_EXIT( BUS_DBG_ERROR,
>                         ("Failed to allocate IOU manager.\n") );
>                 return IB_INSUFFICIENT_MEMORY;
>         }
> -       p_bfi->p_iou_mgr = gp_iou_mgr;
> +       p_bfi->p_iou_mgr = p_iou_mgr;
> 
>         /* Construct the load service. */
> -       cl_obj_construct( &gp_iou_mgr->obj, AL_OBJ_TYPE_LOADER );
> +       cl_obj_construct( &p_iou_mgr->obj, AL_OBJ_TYPE_LOADER );
> 
>         p_bfi->p_iou_mgr_obj = &p_bfi->p_iou_mgr->obj; // 
> save for destroy & free
> 
> -       cl_mutex_construct( &gp_iou_mgr->pdo_mutex );
> -       cl_qlist_init( &gp_iou_mgr->iou_list );
> +       cl_mutex_construct( &p_iou_mgr->pdo_mutex );
> +       cl_qlist_init( &p_iou_mgr->iou_list );
> 
> -       cl_status = cl_mutex_init( &gp_iou_mgr->pdo_mutex );
> +       cl_status = cl_mutex_init( &p_iou_mgr->pdo_mutex );
>         if( cl_status != CL_SUCCESS )
>         {
> -               free_iou_mgr( &gp_iou_mgr->obj );
> +               free_iou_mgr( &p_iou_mgr->obj );
>                 BUS_TRACE_EXIT( BUS_DBG_ERROR,
>                         ("cl_mutex_init returned %#x.\n", 
> cl_status) );
>                 return ib_convert_cl_status( cl_status );
>         }
> 
>         /* Initialize the load service object. */
> -       cl_status = cl_obj_init( &gp_iou_mgr->obj, CL_DESTROY_SYNC,
> +       cl_status = cl_obj_init( &p_iou_mgr->obj, CL_DESTROY_SYNC,
>                                                          
> destroying_iou_mgr, NULL, free_iou_mgr );
>         if( cl_status != CL_SUCCESS )
>         {
> -               free_iou_mgr( &gp_iou_mgr->obj );
> +               free_iou_mgr( &p_iou_mgr->obj );
>                 BUS_TRACE_EXIT( BUS_DBG_ERROR,
>                         ("cl_obj_init returned %#x.\n", cl_status) );
>                 return ib_convert_cl_status( cl_status ); @@ 
> -313,7 +313,7 @@
>         status = bus_reg_iou_pnp( p_bfi );
>         if( status != IB_SUCCESS )
>         {
> -               free_iou_mgr( &gp_iou_mgr->obj );
> +               free_iou_mgr( &p_iou_mgr->obj );
>                 BUS_TRACE_EXIT( BUS_DBG_ERROR,
>                         ("bus_reg_iou_pnp returned %s.\n", 
> ib_get_err_str(status)) );
>                 return status;
> @@ -333,7 +333,7 @@
>  {
>         ib_api_status_t                 status;
>         bus_filter_t                    *p_bfi;
> -       iou_mgr_t                               *gp_iou_mgr;
> +       iou_mgr_t                               *p_iou_mgr;
> 
>         BUS_ENTER( BUS_DBG_PNP );
> 
> @@ -343,12 +343,12 @@
>                 BUS_PRINT(BUS_DBG_PNP, ("Failed to find p_bfi 
> by obj %p?\n", p_obj));
>                 return;
>         }
> -       gp_iou_mgr = p_bfi->p_iou_mgr;
> +       p_iou_mgr = p_bfi->p_iou_mgr;
> 
>         BUS_PRINT(BUS_DBG_PNP, ("%s obj %p iou_mgr %p 
> iou_mgr_obj %p\n",
> -                                                       
> p_bfi->whoami, p_obj,gp_iou_mgr,&gp_iou_mgr->obj));
> +                                                       
> p_bfi->whoami, 
> + p_obj,p_iou_mgr,&p_iou_mgr->obj));
> 
> -       CL_ASSERT( gp_iou_mgr == PARENT_STRUCT( p_obj, 
> iou_mgr_t, obj ) );
> +       CL_ASSERT( p_iou_mgr == PARENT_STRUCT( p_obj, 
> iou_mgr_t, obj ) 
> + );
> 
>         /* Deregister for iou PnP events. */
>         if( get_bfi_count() == 1 && bus_globals.h_pnp_iou ) 
> @@ -373,7 +373,7 @@
>         bus_pdo_ext_t   *p_ext;
>         cl_list_item_t  *p_list_item;
>         bus_filter_t    *p_bfi;
> -       iou_mgr_t               *gp_iou_mgr;
> +       iou_mgr_t               *p_iou_mgr;
> 
>         BUS_ENTER( BUS_DBG_PNP );
> 
> @@ -383,14 +383,14 @@
>                 BUS_TRACE( BUS_DBG_ERROR, ("Unable to get 
> p_bfi iou_obj %p?\n", p_obj) );
>                 return;
>         }
> -       gp_iou_mgr = p_bfi->p_iou_mgr;
> -       if ( !gp_iou_mgr ) {
> +       p_iou_mgr = p_bfi->p_iou_mgr;
> +       if ( !p_iou_mgr ) {
>                 BUS_TRACE_EXIT( BUS_DBG_ERROR, ("%s <null> 
> IOU mgr?\n",p_bfi->whoami) );
>                 // if create fails & then free is called, 
> p_bfi->p_iou_mgr == NULL
>                 return;
>         }
> 
> -       CL_ASSERT( gp_iou_mgr == PARENT_STRUCT( p_obj, 
> iou_mgr_t, obj ) );
> +       CL_ASSERT( p_iou_mgr == PARENT_STRUCT( p_obj, 
> iou_mgr_t, obj ) 
> + );
> 
>         BUS_PRINT( BUS_DBG_PNP, ("%s Mark all IOU PDOs as no 
> longer present\n",
>                                                               
>   p_bfi->whoami)); @@ -398,11 +398,11 @@
>          * Mark all IOU PDOs as no longer present.  This will 
> cause them
>          * to be removed when they process the IRP_MN_REMOVE_DEVICE.
>          */
> -       p_list_item = cl_qlist_remove_head( &gp_iou_mgr->iou_list );
> -       while( p_list_item != cl_qlist_end( &gp_iou_mgr->iou_list ) )
> +       p_list_item = cl_qlist_remove_head( &p_iou_mgr->iou_list );
> +       while( p_list_item != cl_qlist_end( &p_iou_mgr->iou_list ) )
>         {
>                 p_ext = PARENT_STRUCT( p_list_item, 
> bus_pdo_ext_t, list_item );
> -               p_list_item = cl_qlist_remove_head( 
> &gp_iou_mgr->iou_list );
> +               p_list_item = cl_qlist_remove_head( 
> &p_iou_mgr->iou_list 
> + );
>                 if( p_ext->cl_ext.pnp_state == SurpriseRemoved )
>                 {
>                         CL_ASSERT( !p_ext->b_present ); @@ 
> -432,9 +432,9 @@
>                 IoDeleteDevice( p_ext->cl_ext.p_self_do );
>         }
> 
> -       cl_mutex_destroy( &gp_iou_mgr->pdo_mutex );
> +       cl_mutex_destroy( &p_iou_mgr->pdo_mutex );
>         cl_obj_deinit( p_obj );
> -       cl_free( gp_iou_mgr );
> +       cl_free( p_iou_mgr );
> 
>         p_bfi->p_iou_mgr = NULL;
>         p_bfi->p_iou_mgr_obj = NULL;
> @@ -531,7 +531,7 @@
>  {
>         NTSTATUS                        status;
>         bus_filter_t            *p_bfi;
> -       iou_mgr_t                       *gp_iou_mgr;
> +       iou_mgr_t                       *p_iou_mgr;
>         DEVICE_RELATIONS        *p_rel;
> 
>         BUS_ENTER( BUS_DBG_PNP );
> @@ -541,12 +541,12 @@
>         /* 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++) {
> -                       gp_iou_mgr = p_bfi->p_iou_mgr;
> -                       if ( !gp_iou_mgr )
> +                       p_iou_mgr = p_bfi->p_iou_mgr;
> +                       if ( !p_iou_mgr )
>                                 continue;
> -                       cl_mutex_acquire( &gp_iou_mgr->pdo_mutex );
> -                       status = bus_get_relations( 
> &gp_iou_mgr->iou_list, ca_guid, p_irp );
> -                       cl_mutex_release( &gp_iou_mgr->pdo_mutex );
> +                       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 ) {
> @@ -562,16 +562,16 @@
>                                                               
>   ("NULL p_bfi from ca_guid %I64x ?\n",ca_guid));
>                 return STATUS_UNSUCCESSFUL;
>         }
> -       gp_iou_mgr = p_bfi->p_iou_mgr;
> +       p_iou_mgr = p_bfi->p_iou_mgr;
> 
>         BUS_PRINT(BUS_DBG_PNP, ("%s for ca_guid %I64x iou_mgr %p\n",
> -                                                       
> p_bfi->whoami, ca_guid, gp_iou_mgr) );
> -       if (!gp_iou_mgr)
> +                                                       
> p_bfi->whoami, ca_guid, p_iou_mgr) );
> +       if (!p_iou_mgr)
>                 return STATUS_NO_SUCH_DEVICE;
> 
> -       cl_mutex_acquire( &gp_iou_mgr->pdo_mutex );
> -       status = bus_get_relations( &gp_iou_mgr->iou_list, 
> ca_guid, p_irp );
> -       cl_mutex_release( &gp_iou_mgr->pdo_mutex );
> +       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 );
> 
>         BUS_EXIT( BUS_DBG_PNP );
>         return status;
> @@ -588,13 +588,13 @@
>         bus_iou_ext_t   *p_iou_ext;
>         bus_pdo_ext_t   *p_pdo_ext = NULL;
>         size_t                  n_devs = 0;
> -       iou_mgr_t               *gp_iou_mgr = p_bfi->p_iou_mgr;
> -       cl_qlist_t              *p_pdo_list = &gp_iou_mgr->iou_list;
> +       iou_mgr_t               *p_iou_mgr = p_bfi->p_iou_mgr;
> +       cl_qlist_t              *p_pdo_list = &p_iou_mgr->iou_list;
>         iou_pnp_ctx_t   *p_ctx = p_pnp_rec->pnp_rec.context;
> 
>         BUS_ENTER( BUS_DBG_PNP );
> 
> -       cl_mutex_acquire( &gp_iou_mgr->pdo_mutex );
> +       cl_mutex_acquire( &p_iou_mgr->pdo_mutex );
> 
>         /* Count the number of child devices. */
>         for( p_list_item = cl_qlist_head( p_pdo_list ); @@ 
> -655,7 +655,7 @@
>                 status = IB_NOT_FOUND;
>         }
> 
> -       cl_mutex_release( &gp_iou_mgr->pdo_mutex );
> +       cl_mutex_release( &p_iou_mgr->pdo_mutex );
> 
>         BUS_EXIT( BUS_DBG_PNP );
>         return status;
> @@ -669,7 +669,7 @@
>         DEVICE_OBJECT   *p_pdo;
>         bus_iou_ext_t   *p_iou_ext;
>         bus_filter_t    *p_bfi;
> -       iou_mgr_t               *gp_iou_mgr;
> +       iou_mgr_t               *p_iou_mgr;
>         iou_pnp_ctx_t   *p_ctx = p_pnp_rec->pnp_rec.context;
> 
>         BUS_ENTER( BUS_DBG_PNP );
> @@ -702,7 +702,7 @@
>                                         ("%s ca_guid %I64x 
> iou_guid(%I64x) ALLOC p_ctx @ %p\n",
>                                         p_bfi->whoami, 
> p_bfi->ca_guid, p_pnp_rec->guid,p_ctx));
>         }
> -       gp_iou_mgr = p_bfi->p_iou_mgr;
> +       p_iou_mgr = p_bfi->p_iou_mgr;
> 
>         /* Upon hibernating the computer IB_BUS driver 
> doesn't remove PDO, but
>            marks with a flag. So we first try to find an 
> existing PDO for this port, @@ -774,9 +774,9 @@
>         }
> 
>         /* Store the device extension in the PDO list for 
> future queries. */
> -       cl_mutex_acquire( &gp_iou_mgr->pdo_mutex );
> -       cl_qlist_insert_tail( &gp_iou_mgr->iou_list, 
> &p_iou_ext->pdo.list_item );
> -       cl_mutex_release( &gp_iou_mgr->pdo_mutex );
> +       cl_mutex_acquire( &p_iou_mgr->pdo_mutex );
> +       cl_qlist_insert_tail( &p_iou_mgr->iou_list, 
> &p_iou_ext->pdo.list_item );
> +       cl_mutex_release( &p_iou_mgr->pdo_mutex );
> 
>         /*
>          * Set the context of the PNP event.  The context is 
> passed in for future @@ -805,7 +805,7 @@
>         IN                              ib_pnp_iou_rec_t*     
>                   p_pnp_rec )
>  {
>         bus_pdo_ext_t   *p_ext;
> -       iou_mgr_t               *gp_iou_mgr;
> +       iou_mgr_t               *p_iou_mgr;
>         bus_filter_t    *p_bfi;
>         iou_pnp_ctx_t   *p_ctx = p_pnp_rec->pnp_rec.context;
> 
> @@ -833,7 +833,7 @@
>                 return;
>         }
> 
> -       gp_iou_mgr = p_bfi->p_iou_mgr;
> +       p_iou_mgr = p_bfi->p_iou_mgr;
> 
>         /* Within the PNP record's context is the IOU extension; see
>          * was_hibernated().
> @@ -854,7 +854,7 @@
>          * reference on the CA object in order to allow the 
> removal of the HCA
>          * to proceed should it occur before the port's PDO 
> is cleaned up.
>          */
> -       cl_mutex_acquire( &gp_iou_mgr->pdo_mutex );
> +       cl_mutex_acquire( &p_iou_mgr->pdo_mutex );
>         if ( !p_ext->h_ca )
>         {
>                 BUS_TRACE_EXIT( BUS_DBG_PNP, ("NULL h_ca? 
> p_ext %p\n", p_ext ) ); @@ -896,7 +896,7 @@
>         deref_al_obj( &p_ext->h_ca->obj );
>         p_ext->h_ca = NULL;
> 
> -       cl_mutex_release( &gp_iou_mgr->pdo_mutex );
> +       cl_mutex_release( &p_iou_mgr->pdo_mutex );
> 
>         BUS_EXIT( BUS_DBG_PNP );
>  }
> @@ -965,18 +965,18 @@
>  {
>         bus_iou_ext_t   *p_ext;
>         POWER_STATE             po_state;
> -       iou_mgr_t               *gp_iou_mgr;
> +       iou_mgr_t               *p_iou_mgr;
> 
>         BUS_ENTER( BUS_DBG_PNP );
> 
>         p_ext = p_dev_obj->DeviceExtension;
> -       gp_iou_mgr = p_ext->pdo.p_parent_ext->bus_filter->p_iou_mgr;
> +       p_iou_mgr = p_ext->pdo.p_parent_ext->bus_filter->p_iou_mgr;
> 
>         /* Remove this PDO from its list. */
> -       cl_mutex_acquire( &gp_iou_mgr->pdo_mutex );
> +       cl_mutex_acquire( &p_iou_mgr->pdo_mutex );
>         BUS_TRACE( BUS_DBG_PNP, ("Removing IOU from list.\n") );
> -       cl_qlist_remove_item( &gp_iou_mgr->iou_list, 
> &p_ext->pdo.list_item );
> -       cl_mutex_release( &gp_iou_mgr->pdo_mutex );
> +       cl_qlist_remove_item( &p_iou_mgr->iou_list, 
> &p_ext->pdo.list_item );
> +       cl_mutex_release( &p_iou_mgr->pdo_mutex );
>         po_state.DeviceState = PowerDeviceD3;
>         PoSetPowerState( p_ext->pdo.cl_ext.p_pdo, 
> DevicePowerState, po_state );
> 
> 



More information about the ofw mailing list