[ofw] [PATCH v2] Clean up TO_LONG_PTR use in ib_types.h

Leonid Keller leonid at mellanox.co.il
Sun Jul 13 03:40:27 PDT 2008


Applied in 1383. Thank you. 

> -----Original Message-----
> From: ofw-bounces at lists.openfabrics.org 
> [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Fab Tillier
> Sent: Friday, July 11, 2008 10:55 PM
> To: ofw at lists.openfabrics.org
> Subject: [ofw] [PATCH v2] Clean up TO_LONG_PTR use in ib_types.h
> 
> The TO_LONG_PTR macro use in ib_types.h damaged the 
> indentation and spacing of fields.  This patch cleans up 
> alignment and whitespace so that the code stops making me cringe.
> 
> This update accounts for changes in the patches to remove the 
> XXX_PTR64 macros.
> 
> Signed-off-by: Fab Tillier <ftillier at microsoft.com>
> 
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: 
> old\inc\iba\ib_types.h trunk\inc\iba\ib_types.h
> --- old\inc\iba\ib_types.h      Fri Jul 11 12:51:47 2008
> +++ trunk\inc\iba\ib_types.h    Fri Jul 11 12:52:03 2008
> @@ -39,7 +39,6 @@
> 
>  #include <complib/cl_types.h>
>  #include <complib/cl_byteswap.h>
> -//#include <al_fmr_pool.h>
> 
>  #define HDL_TO_PTR(hdl) Handle64ToHandle( (void * __ptr64) (hdl))
> 
> @@ -49,8 +48,7 @@
>  #define IB_CONCAT(str1, str2) str1##str2
> 
>  #define TO_LONG_PTR(type,member_name) \
> -    union { type member_name;  uint64_t 
> IB_CONCAT(member_name,_padding) ; }
> -
> +       union { type member_name;  uint64_t 
> + IB_CONCAT(member_name,_padding); }
> 
> 
>  #ifdef CL_KERNEL
> @@ -600,7 +598,7 @@ ib_class_is_vendor_specific_low(
>         IN              const   uint8_t class_code )
>  {
>         return( (class_code >= IB_MCLASS_VENDOR_LOW_RANGE_MIN) &&
> -           (class_code <= IB_MCLASS_VENDOR_LOW_RANGE_MAX)) ;
> +           (class_code <= IB_MCLASS_VENDOR_LOW_RANGE_MAX));
>  }
>  /*
>  * PARAMETERS
> @@ -632,7 +630,7 @@ ib_class_is_vendor_specific_high(
>         IN              const   uint8_t class_code )
>  {
>         return( (class_code >= IB_MCLASS_VENDOR_HIGH_RANGE_MIN) &&
> -           (class_code <= IB_MCLASS_VENDOR_HIGH_RANGE_MAX)) ;
> +           (class_code <= IB_MCLASS_VENDOR_HIGH_RANGE_MAX));
>  }
>  /*
>  * PARAMETERS
> @@ -2122,7 +2120,7 @@ ib_mgid_get_scope(  */  AL_INLINE void 
> AL_API  ib_mgid_set_scope(
> -        IN             ib_gid_t* const         p_gid,
> +       IN                      ib_gid_t* const p_gid,
>         IN      const   uint8_t                 scope )
>  {
>         p_gid->raw[1] &= 0xF0;
> @@ -5109,8 +5107,8 @@ ib_port_info_set_timeout(  */  
> AL_INLINE void AL_API  ib_port_info_set_client_rereg(
> -       IN              ib_port_info_t* const   p_pi,
> -       IN      const   uint8_t                 client_rereg )
> +       IN                              ib_port_info_t* const   p_pi,
> +       IN              const   uint8_t                       
>           client_rereg )
>  {
>         CL_ASSERT( client_rereg <= 0x1 );
>         p_pi->subnet_timeout =
> @@ -6190,8 +6188,8 @@ typedef struct _ib_pkey_table_record
>         ib_net16_t              lid; // for CA: lid of port, 
> for switch lid of port 0
>         uint16_t                block_num;
>         uint8_t                 port_num; // for switch: port 
> number, for CA: reserved
> -       uint8_t                 reserved1;
> -       uint16_t                reserved2;
> +       uint8_t                 reserved1;
> +       uint16_t                reserved2;
>         ib_pkey_table_t         pkey_tbl;
> 
>  }      PACK_SUFFIX ib_pkey_table_record_t;
> @@ -8951,11 +8949,10 @@ ib_get_async_event_str(  */  typedef 
> struct _ib_event_rec  {
> -
> -       TO_LONG_PTR(void* ,     context) ;
> +       TO_LONG_PTR(void*,              context);
>         ib_async_event_t                type;
> 
> -       //HCA vendor specific event information.
> +       /* HCA vendor specific event information. */
>         uint64_t                                vendor_specific;
> 
>         /* The following structures are valid only for trap 
> types. */ @@ -9167,8 +9164,8 @@ typedef struct _ib_port_attr
>          * Pointers at the end of the structure to allow 
> doing a simple
>          * memory comparison of contents up to the first pointer.
>          */
> -       TO_LONG_PTR(ib_gid_t* ,         p_gid_table) ;
> -       TO_LONG_PTR(ib_net16_t* ,               p_pkey_table) ;
> +       TO_LONG_PTR(ib_gid_t*,  p_gid_table);
> +       TO_LONG_PTR(ib_net16_t*,p_pkey_table);
> 
>  }      ib_port_attr_t;
>  /*
> @@ -9265,8 +9262,8 @@ typedef struct _ib_ca_attr
>         uint32_t                                num_page_sizes;
>         uint8_t                                 num_ports;
> 
> -       TO_LONG_PTR(uint32_t* ,         p_page_size) ;
> -       TO_LONG_PTR(ib_port_attr_t* ,   p_port_attr) ;
> +       TO_LONG_PTR(uint32_t*,  p_page_size);
> +       TO_LONG_PTR(ib_port_attr_t*, p_port_attr);
> 
>  }      ib_ca_attr_t;
>  /*
> @@ -9778,9 +9775,9 @@ typedef struct _ib_qp_create
>         uint32_t                                sq_sge;
>         uint32_t                                rq_sge;
> 
> -TO_LONG_PTR(   ib_cq_handle_t ,                        h_sq_cq) ;
> -TO_LONG_PTR(   ib_cq_handle_t ,                        h_rq_cq) ;
> -TO_LONG_PTR(   ib_srq_handle_t ,                       h_srq) ;
> +       TO_LONG_PTR(ib_cq_handle_t, h_sq_cq);
> +       TO_LONG_PTR(ib_cq_handle_t, h_rq_cq);
> +       TO_LONG_PTR(ib_srq_handle_t, h_srq);
> 
>         boolean_t                               sq_signaled;
> 
> @@ -9855,7 +9852,7 @@ TO_LONG_PTR(      ib_srq_handle_t ,     
>                   h_srq)
>  */
>  typedef struct _ib_qp_attr
>  {
> -TO_LONG_PTR(   ib_pd_handle_t ,                        h_pd) ;
> +       TO_LONG_PTR(ib_pd_handle_t, h_pd);
>         ib_qp_type_t                    qp_type;
>         ib_access_t                             access_ctrl;
>         uint16_t                                pkey_index;
> @@ -9868,9 +9865,9 @@ TO_LONG_PTR(      ib_pd_handle_t ,      
>                   h_pd) ;
>         uint8_t                                 init_depth;
>         uint8_t                                 resp_res;
> 
> -TO_LONG_PTR(   ib_cq_handle_t ,                        h_sq_cq) ;
> -TO_LONG_PTR(   ib_cq_handle_t ,                        h_rq_cq) ;
> -TO_LONG_PTR(   ib_srq_handle_t ,                       h_srq) ;
> +       TO_LONG_PTR(ib_cq_handle_t, h_sq_cq);
> +       TO_LONG_PTR(ib_cq_handle_t, h_rq_cq);
> +       TO_LONG_PTR(ib_srq_handle_t,h_srq);
> 
>         boolean_t                               sq_signaled;
> 
> @@ -10164,12 +10161,12 @@ typedef uint32_t                    
>                   ib_send_opt_t;
>  */
>  typedef struct _ib_send_wr
>  {
> -       TO_LONG_PTR(struct _ib_send_wr* ,       p_next) ;
> +       TO_LONG_PTR(struct _ib_send_wr*, p_next);
>         uint64_t                                        wr_id;
>         ib_wr_type_t                            wr_type;
>         ib_send_opt_t                           send_opt;
>         uint32_t                                        num_ds;
> -       TO_LONG_PTR(ib_local_ds_t* ,            ds_array) ;
> +       TO_LONG_PTR(ib_local_ds_t*, ds_array);
>         ib_net32_t                                      
> immediate_data;
> 
>         union _send_dgrm
> @@ -10178,9 +10175,9 @@ typedef struct _ib_send_wr
>                 {
>                         ib_net32_t              remote_qp;
>                         ib_net32_t              remote_qkey;
> -TO_LONG_PTR(                   ib_av_handle_t ,        h_av) ;
> +                       TO_LONG_PTR(ib_av_handle_t, h_av);
>                         uint16_t                pkey_index;
> -                       TO_LONG_PTR(void* ,     rsvd) ;
> +                       TO_LONG_PTR(void*, rsvd);
> 
>                 }       ud;
> 
> @@ -10338,10 +10335,10 @@ TO_LONG_PTR(                  
> ib_av_handle_t ,        h_av) ;
>  */
>  typedef struct _ib_recv_wr
>  {
> -       TO_LONG_PTR(struct _ib_recv_wr* ,       p_next) ;
> +       TO_LONG_PTR(struct _ib_recv_wr*, p_next);
>         uint64_t                                        wr_id;
>         uint32_t                                        num_ds;
> -       TO_LONG_PTR(ib_local_ds_t* ,            ds_array) ;
> +       TO_LONG_PTR(ib_local_ds_t*,     ds_array);
> 
>  }      ib_recv_wr_t;
>  /*
> @@ -10381,7 +10378,7 @@ typedef struct _ib_bind_wr
>         uint64_t                                wr_id;
>         ib_send_opt_t                   send_opt;
> 
> -TO_LONG_PTR(   ib_mr_handle_t ,                        h_mr) ;
> +       TO_LONG_PTR(ib_mr_handle_t, h_mr);
>         ib_access_t                             access_ctrl;
>         net32_t                                 current_rkey;
> 
> @@ -10657,7 +10654,7 @@ typedef uint32_t                      
>                   ib_recv_opt_t;
>  */
>  typedef struct _ib_wc
>  {
> -       TO_LONG_PTR(struct _ib_wc* ,    p_next) ;
> +       TO_LONG_PTR(struct _ib_wc*, p_next);
>         uint64_t                                wr_id;
>         ib_wc_type_t                    wc_type;
> 
> @@ -10836,7 +10833,7 @@ typedef struct _ib_wc  */  typedef 
> struct _ib_mr_create  {
> -       TO_LONG_PTR(void* ,                     vaddr) ;
> +       TO_LONG_PTR(void*,              vaddr);
>         uint64_t                                length;
>         ib_access_t                             access_ctrl;
>  }      ib_mr_create_t;
> @@ -10982,7 +10979,7 @@ typedef struct _ib_phys_create  {
>         uint64_t                                        length;
>         uint32_t                                        num_ranges;
> -       TO_LONG_PTR(ib_phys_range_t* ,  range_array) ;
> +       ib_phys_range_t*                        range_array;
>         uint32_t                                        buf_offset;
>         uint32_t                                        hca_page_size;
>         ib_access_t                                     access_ctrl;
> @@ -11024,7 +11021,7 @@ typedef struct _ib_phys_create  */  
> typedef struct _ib_mr_attr  {
> -TO_LONG_PTR(   ib_pd_handle_t ,                        h_pd) ;
> +       TO_LONG_PTR(ib_pd_handle_t, h_pd);
>         uint64_t                                local_lb;
>         uint64_t                                local_ub;
>         uint64_t                                remote_lb;
> @@ -11315,7 +11312,7 @@ typedef struct _ib_ci_op
>         IN                              uint32_t              
>                           buf_size;
>         IN                              uint32_t              
>                           buf_info;
>         IN      OUT                     int32_t               
>                           status;
> -    IN OUT                     TO_LONG_PTR(void*, p_buf) 
> OPTIONAL; // Do not put it last in the structure, because of 
> memory alignment
> +       IN      OUT                     TO_LONG_PTR(void*,    
>                   p_buf) OPTIONAL; // Do not put it last in 
> the structure, because of memory alignment
>                 OUT                     uint32_t              
>                           num_bytes_ret;
> 
>  }      ib_ci_op_t;
> 



More information about the ofw mailing list