All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [OPENSM] match functions to prototypes in header file
       [not found] ` <3DE88517D38A4EB0B49A2E3AAF96D005-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
@ 2009-10-01 18:31   ` Sasha Khapyorsky
  2009-10-01 18:33     ` Bart Van Assche
                       ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sasha Khapyorsky @ 2009-10-01 18:31 UTC (permalink / raw)
  To: Stan C. Smith
  Cc: ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5, linux-rdma, Sean Hefty

On 13:44 Wed 30 Sep     , Stan C. Smith wrote:
> 
> From the looks of the cut-n-past from git diff output the emailer is not expanding tabs
>  as envisioned, hence the attached Linux EOL patch file; grrrrrrrrrrr.

I'm not using Outlook, but guess that there are other people on the list
which are, maybe they could suggest some useful techniques.

> Signed-off-by: stan smith <stan.smith-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> 
> diff --git a/opensm/opensm/osm_helper.c b/opensm/opensm/osm_helper.c
> index 4b4e320..28edb04 100644
> --- a/opensm/opensm/osm_helper.c
> +++ b/opensm/opensm/osm_helper.c
> @@ -780,10 +780,11 @@ static void dbg_get_capabilities_str(IN char *p_buf, IN const uint32_t buf_size,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_port_info(IN osm_log_t * p_log, IN const ib_net64_t node_guid,
> +void osm_dump_port_info(IN osm_log_t * const p_log,
> +			IN const ib_net64_t node_guid,
>  			IN const ib_net64_t port_guid,
>  			IN const uint8_t port_num,
> -			IN const ib_port_info_t * p_pi,
> +			IN const ib_port_info_t * const p_pi,
>  			IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -870,8 +871,8 @@ void osm_dump_port_info(IN osm_log_t * p_log, IN const ib_net64_t node_guid,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_portinfo_record(IN osm_log_t * p_log,
> -			      IN const ib_portinfo_record_t * p_pir,
> +void osm_dump_portinfo_record(IN osm_log_t * const p_log,
> +			      IN const ib_portinfo_record_t * const p_pir,
>  			      IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -956,8 +957,8 @@ void osm_dump_portinfo_record(IN osm_log_t * p_log,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_guidinfo_record(IN osm_log_t * p_log,
> -			      IN const ib_guidinfo_record_t * p_gir,
> +void osm_dump_guidinfo_record(IN osm_log_t * const p_log,
> +			      IN const ib_guidinfo_record_t * const p_gir,
>  			      IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -995,7 +996,8 @@ void osm_dump_guidinfo_record(IN osm_log_t * p_log,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_node_info(IN osm_log_t * p_log, IN const ib_node_info_t * p_ni,
> +void osm_dump_node_info(IN osm_log_t * const p_log,
> +			IN const ib_node_info_t * const p_ni,
>  			IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1030,8 +1032,8 @@ void osm_dump_node_info(IN osm_log_t * p_log, IN const ib_node_info_t * p_ni,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_node_record(IN osm_log_t * p_log,
> -			  IN const ib_node_record_t * p_nr,
> +void osm_dump_node_record(IN osm_log_t * const p_log,
> +			  IN const ib_node_record_t * const p_nr,
>  			  IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1080,7 +1082,8 @@ void osm_dump_node_record(IN osm_log_t * p_log,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_path_record(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr,
> +void osm_dump_path_record(IN osm_log_t * const p_log,
> +			  IN const ib_path_rec_t * const p_pr,
>  			  IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1106,9 +1109,9 @@ void osm_dump_path_record(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr,
>  			"\t\t\t\tresv2...................0x%X\n"
>  			"\t\t\t\tresv3...................0x%X\n",
>  			cl_ntoh64(p_pr->service_id),
> -			inet_ntop(AF_INET6, p_pr->dgid.raw, gid_str,
> +			inet_ntop(AF_INET6, (void*)p_pr->dgid.raw, gid_str,

And why is such casting(s) needed?

Also wouldn't it be simpler to remove 'const' in "type * const var"
function parameter definitions? This restricts only value of a pointer
(not structure content), and since function parameters are passed by
values such restriction is only related to a function implementation
and actually meanless in sense of API. Thoughts?

Sasha

>  				  sizeof gid_str),
> -			inet_ntop(AF_INET6, p_pr->sgid.raw, gid_str2,
> +			inet_ntop(AF_INET6, (void*)p_pr->sgid.raw, gid_str2,
>  				  sizeof gid_str2),
>  			cl_ntoh16(p_pr->dlid),
>  			cl_ntoh16(p_pr->slid),
> @@ -1129,8 +1132,8 @@ void osm_dump_path_record(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_multipath_record(IN osm_log_t * p_log,
> -			       IN const ib_multipath_rec_t * p_mpr,
> +void osm_dump_multipath_record(IN osm_log_t * const p_log,
> +			       IN const ib_multipath_rec_t * const p_mpr,
>  			       IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1144,7 +1147,7 @@ void osm_dump_multipath_record(IN osm_log_t * p_log,
>  				n += sprintf(buf_line + n,
>  					     "\t\t\t\tsgid%02d.................."
>  					     "%s\n", i + 1,
> -					     inet_ntop(AF_INET6, p_gid->raw,
> +					     inet_ntop(AF_INET6, (void*)p_gid->raw,
>  						       gid_str, sizeof gid_str));
>  				p_gid++;
>  			}
> @@ -1154,7 +1157,7 @@ void osm_dump_multipath_record(IN osm_log_t * p_log,
>  				n += sprintf(buf_line + n,
>  					     "\t\t\t\tdgid%02d.................."
>  					     "%s\n", i + 1,
> -					     inet_ntop(AF_INET6, p_gid->raw,
> +					     inet_ntop(AF_INET6, (void*)p_gid->raw,
>  						       gid_str, sizeof gid_str));
>  				p_gid++;
>  			}
> @@ -1193,7 +1196,8 @@ void osm_dump_multipath_record(IN osm_log_t * p_log,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_mc_record(IN osm_log_t * p_log, IN const ib_member_rec_t * p_mcmr,
> +void osm_dump_mc_record(IN osm_log_t * const p_log,
> +			IN const ib_member_rec_t * const p_mcmr,
>  			IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1213,9 +1217,9 @@ void osm_dump_mc_record(IN osm_log_t * p_log, IN const ib_member_rec_t * p_mcmr,
>  			"\t\t\t\tSLFlowLabelHopLimit.....0x%X\n"
>  			"\t\t\t\tScopeState..............0x%X\n"
>  			"\t\t\t\tProxyJoin...............0x%X\n",
> -			inet_ntop(AF_INET6, p_mcmr->mgid.raw, gid_str,
> +			inet_ntop(AF_INET6, (void*)p_mcmr->mgid.raw, gid_str,
>  				  sizeof gid_str),
> -			inet_ntop(AF_INET6, p_mcmr->port_gid.raw, gid_str2,
> +			inet_ntop(AF_INET6, (void*)p_mcmr->port_gid.raw, gid_str2,
>  				  sizeof gid_str2),
>  			cl_ntoh32(p_mcmr->qkey),
>  			cl_ntoh16(p_mcmr->mlid),
> @@ -1231,8 +1235,8 @@ void osm_dump_mc_record(IN osm_log_t * p_log, IN const ib_member_rec_t * p_mcmr,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_service_record(IN osm_log_t * p_log,
> -			     IN const ib_service_record_t * p_sr,
> +void osm_dump_service_record(IN osm_log_t * const p_log,
> +			     IN const ib_service_record_t * const p_sr,
>  			     IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1299,7 +1303,7 @@ void osm_dump_service_record(IN osm_log_t * p_log,
>  			"\t\t\t\tServiceData64.1.........0x%016" PRIx64 "\n"
>  			"\t\t\t\tServiceData64.2.........0x%016" PRIx64 "\n",
>  			cl_ntoh64(p_sr->service_id),
> -			inet_ntop(AF_INET6, p_sr->service_gid.raw, gid_str,
> +			inet_ntop(AF_INET6, (void*)p_sr->service_gid.raw, gid_str,
>  				  sizeof gid_str),
>  			cl_ntoh16(p_sr->service_pkey),
>  			cl_ntoh32(p_sr->service_lease),
> @@ -1332,8 +1336,8 @@ void osm_dump_service_record(IN osm_log_t * p_log,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_inform_info(IN osm_log_t * p_log,
> -			  IN const ib_inform_info_t * p_ii,
> +void osm_dump_inform_info(IN osm_log_t * const p_log,
> +			  IN const ib_inform_info_t * const p_ii,
>  			  IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1356,7 +1360,7 @@ void osm_dump_inform_info(IN osm_log_t * p_log,
>  				"\t\t\t\tqpn.....................0x%06X\n"
>  				"\t\t\t\tresp_time_val...........0x%X\n"
>  				"\t\t\t\tnode_type...............0x%06X\n" "",
> -				inet_ntop(AF_INET6, p_ii->gid.raw, gid_str,
> +				inet_ntop(AF_INET6, (void*)p_ii->gid.raw, gid_str,
>  					  sizeof gid_str),
>  				cl_ntoh16(p_ii->lid_range_begin),
>  				cl_ntoh16(p_ii->lid_range_end),
> @@ -1378,7 +1382,7 @@ void osm_dump_inform_info(IN osm_log_t * p_log,
>  				"\t\t\t\tqpn.....................0x%06X\n"
>  				"\t\t\t\tresp_time_val...........0x%X\n"
>  				"\t\t\t\tvendor_id...............0x%06X\n" "",
> -				inet_ntop(AF_INET6, p_ii->gid.raw, gid_str,
> +				inet_ntop(AF_INET6, (void*)p_ii->gid.raw, gid_str,
>  					  sizeof gid_str),
>  				cl_ntoh16(p_ii->lid_range_begin),
>  				cl_ntoh16(p_ii->lid_range_end),
> @@ -1393,8 +1397,8 @@ void osm_dump_inform_info(IN osm_log_t * p_log,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_inform_info_record(IN osm_log_t * p_log,
> -				 IN const ib_inform_info_record_t * p_iir,
> +void osm_dump_inform_info_record(IN osm_log_t * const p_log,
> +				 IN const ib_inform_info_record_t * const p_iir,
>  				 IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1423,10 +1427,10 @@ void osm_dump_inform_info_record(IN osm_log_t * p_log,
>  				"\t\t\t\tqpn.....................0x%06X\n"
>  				"\t\t\t\tresp_time_val...........0x%X\n"
>  				"\t\t\t\tnode_type...............0x%06X\n" "",
> -				inet_ntop(AF_INET6, p_iir->subscriber_gid.raw,
> +				inet_ntop(AF_INET6, (void*)p_iir->subscriber_gid.raw,
>  					  gid_str, sizeof gid_str),
>  				cl_ntoh16(p_iir->subscriber_enum),
> -				inet_ntop(AF_INET6, p_iir->inform_info.gid.raw,
> +				inet_ntop(AF_INET6, (void*)p_iir->inform_info.gid.raw,
>  					  gid_str2, sizeof gid_str2),
>  				cl_ntoh16(p_iir->inform_info.lid_range_begin),
>  				cl_ntoh16(p_iir->inform_info.lid_range_end),
> @@ -1455,10 +1459,10 @@ void osm_dump_inform_info_record(IN osm_log_t * p_log,
>  				"\t\t\t\tqpn.....................0x%06X\n"
>  				"\t\t\t\tresp_time_val...........0x%X\n"
>  				"\t\t\t\tvendor_id...............0x%06X\n" "",
> -				inet_ntop(AF_INET6, p_iir->subscriber_gid.raw,
> +				inet_ntop(AF_INET6, (void*)p_iir->subscriber_gid.raw,
>  					  gid_str, sizeof gid_str),
>  				cl_ntoh16(p_iir->subscriber_enum),
> -				inet_ntop(AF_INET6, p_iir->inform_info.gid.raw,
> +				inet_ntop(AF_INET6, (void*)p_iir->inform_info.gid.raw,
>  					  gid_str2, sizeof gid_str2),
>  				cl_ntoh16(p_iir->inform_info.lid_range_begin),
>  				cl_ntoh16(p_iir->inform_info.lid_range_end),
> @@ -1476,8 +1480,8 @@ void osm_dump_inform_info_record(IN osm_log_t * p_log,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_link_record(IN osm_log_t * p_log,
> -			  IN const ib_link_record_t * p_lr,
> +void osm_dump_link_record(IN osm_log_t * const p_log,
> +			  IN const ib_link_record_t * const p_lr,
>  			  IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1495,8 +1499,8 @@ void osm_dump_link_record(IN osm_log_t * p_log,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_switch_info(IN osm_log_t * p_log,
> -			  IN const ib_switch_info_t * p_si,
> +void osm_dump_switch_info(IN osm_log_t * const p_log,
> +			  IN const ib_switch_info_t * const p_si,
>  			  IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1530,8 +1534,8 @@ void osm_dump_switch_info(IN osm_log_t * p_log,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_switch_info_record(IN osm_log_t * p_log,
> -				 IN const ib_switch_info_record_t * p_sir,
> +void osm_dump_switch_info_record(IN osm_log_t * const p_log,
> +				 IN const ib_switch_info_record_t * const p_sir,
>  				 IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1568,9 +1572,9 @@ void osm_dump_switch_info_record(IN osm_log_t * p_log,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_pkey_block(IN osm_log_t * p_log, IN uint64_t port_guid,
> +void osm_dump_pkey_block(IN osm_log_t * const p_log, IN uint64_t port_guid,
>  			 IN uint16_t block_num, IN uint8_t port_num,
> -			 IN const ib_pkey_table_t * p_pkey_tbl,
> +			 IN const ib_pkey_table_t * const p_pkey_tbl,
>  			 IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1592,9 +1596,9 @@ void osm_dump_pkey_block(IN osm_log_t * p_log, IN uint64_t port_guid,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_slvl_map_table(IN osm_log_t * p_log, IN uint64_t port_guid,
> +void osm_dump_slvl_map_table(IN osm_log_t * const p_log, IN uint64_t port_guid,
>  			     IN uint8_t in_port_num, IN uint8_t out_port_num,
> -			     IN const ib_slvl_table_t * p_slvl_tbl,
> +			     IN const ib_slvl_table_t * const p_slvl_tbl,
>  			     IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1619,9 +1623,9 @@ void osm_dump_slvl_map_table(IN osm_log_t * p_log, IN uint64_t port_guid,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_vl_arb_table(IN osm_log_t * p_log, IN uint64_t port_guid,
> +void osm_dump_vl_arb_table(IN osm_log_t * const p_log, IN uint64_t port_guid,
>  			   IN uint8_t block_num, IN uint8_t port_num,
> -			   IN const ib_vl_arb_table_t * p_vla_tbl,
> +			   IN const ib_vl_arb_table_t * const p_vla_tbl,
>  			   IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1645,7 +1649,8 @@ void osm_dump_vl_arb_table(IN osm_log_t * p_log, IN uint64_t port_guid,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_sm_info(IN osm_log_t * p_log, IN const ib_sm_info_t * p_smi,
> +void osm_dump_sm_info(IN osm_log_t * const p_log,
> +		      IN const ib_sm_info_t * const p_smi,
>  		      IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1666,8 +1671,8 @@ void osm_dump_sm_info(IN osm_log_t * p_log, IN const ib_sm_info_t * p_smi,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_sm_info_record(IN osm_log_t * p_log,
> -			     IN const ib_sminfo_record_t * p_smir,
> +void osm_dump_sm_info_record(IN osm_log_t * const p_log,
> +			     IN const ib_sminfo_record_t * const p_smir,
>  			     IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1694,7 +1699,7 @@ void osm_dump_sm_info_record(IN osm_log_t * p_log,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_notice(IN osm_log_t * p_log,
> +void osm_dump_notice(IN osm_log_t * const p_log,
>  		     IN const ib_mad_notice_attr_t * p_ntci,
>  		     IN const osm_log_level_t log_level)
>  {
> @@ -1716,7 +1721,7 @@ void osm_dump_notice(IN osm_log_t * p_log,
>  		case 67:
>  			sprintf(buff,
>  				"\t\t\t\tsrc_gid..................%s\n",
> -				inet_ntop(AF_INET6, p_ntci->data_details.
> +				inet_ntop(AF_INET6, (void*)p_ntci->data_details.
>  					  ntc_64_67.gid.raw, gid_str,
>  					  sizeof gid_str));
>  			break;
> @@ -1824,10 +1829,10 @@ void osm_dump_notice(IN osm_log_t * p_log,
>  					  qp1) & 0xffffff,
>  				cl_ntoh32(p_ntci->data_details.ntc_257_258.
>  					  qp2) & 0xffffff,
> -				inet_ntop(AF_INET6, p_ntci->data_details.
> +				inet_ntop(AF_INET6, (void*)p_ntci->data_details.
>  					  ntc_257_258.gid1.raw, gid_str,
>  					  sizeof gid_str),
> -				inet_ntop(AF_INET6, p_ntci->data_details.
> +				inet_ntop(AF_INET6, (void*)p_ntci->data_details.
>  					  ntc_257_258.gid2.raw, gid_str2,
>  					  sizeof gid_str2));
>  			break;
> @@ -1854,10 +1859,10 @@ void osm_dump_notice(IN osm_log_t * p_log,
>  				cl_ntoh32(p_ntci->data_details.ntc_259.
>  					  sl_qp1) & 0xffffff,
>  				cl_ntoh32(p_ntci->data_details.ntc_259.qp2),
> -				inet_ntop(AF_INET6, p_ntci->data_details.
> +				inet_ntop(AF_INET6, (void*)p_ntci->data_details.
>  					  ntc_259.gid1.raw, gid_str,
>  					  sizeof gid_str),
> -				inet_ntop(AF_INET6, p_ntci->data_details.
> +				inet_ntop(AF_INET6, (void*)p_ntci->data_details.
>  					  ntc_259.gid2.raw, gid_str2,
>  					  sizeof gid_str2),
>  				cl_ntoh16(p_ntci->data_details.ntc_259.sw_lid),
> @@ -1889,7 +1894,8 @@ void osm_dump_notice(IN osm_log_t * p_log,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_dr_smp(IN osm_log_t * p_log, IN const ib_smp_t * p_smp,
> +void osm_dump_dr_smp(IN osm_log_t * const p_log,
> +		     IN const ib_smp_t * const p_smp,
>  		     IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -1996,7 +2002,8 @@ void osm_dump_dr_smp(IN osm_log_t * p_log, IN const ib_smp_t * p_smp,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_sa_mad(IN osm_log_t * p_log, IN const ib_sa_mad_t * p_mad,
> +void osm_dump_sa_mad(IN osm_log_t * const p_log,
> +		     IN const ib_sa_mad_t * const p_mad,
>  		     IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -2059,7 +2066,8 @@ void osm_dump_sa_mad(IN osm_log_t * p_log, IN const ib_sa_mad_t * p_mad,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_dr_path(IN osm_log_t * p_log, IN const osm_dr_path_t * p_path,
> +void osm_dump_dr_path(IN osm_log_t * const p_log,
> +		      IN const osm_dr_path_t * const p_path,
>  		      IN const osm_log_level_t log_level)
>  {
>  	if (osm_log_is_active(p_log, log_level)) {
> @@ -2077,7 +2085,8 @@ void osm_dump_dr_path(IN osm_log_t * p_log, IN const osm_dr_path_t * p_path,
>  
>  /**********************************************************************
>   **********************************************************************/
> -void osm_dump_smp_dr_path(IN osm_log_t * p_log, IN const ib_smp_t * p_smp,
> +void osm_dump_smp_dr_path(IN osm_log_t * const p_log,
> +			  IN const ib_smp_t * const p_smp,
>  			  IN const osm_log_level_t log_level)
>  {
>  


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OPENSM] match functions to prototypes in header file
  2009-10-01 18:31   ` [OPENSM] match functions to prototypes in header file Sasha Khapyorsky
@ 2009-10-01 18:33     ` Bart Van Assche
  2009-10-01 19:06       ` Sean Hefty
  2009-10-01 18:51     ` Jason Gunthorpe
  2009-10-01 19:30     ` Smith, Stan
  2 siblings, 1 reply; 8+ messages in thread
From: Bart Van Assche @ 2009-10-01 18:33 UTC (permalink / raw)
  To: Sasha Khapyorsky
  Cc: Stan C. Smith, ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5, linux-rdma,
	Sean Hefty

On Thu, Oct 1, 2009 at 8:31 PM, Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org> wrote:
>
> On 13:44 Wed 30 Sep     , Stan C. Smith wrote:
> >
> > From the looks of the cut-n-past from git diff output the emailer is not expanding tabs
> >  as envisioned, hence the attached Linux EOL patch file; grrrrrrrrrrr.
>
> I'm not using Outlook, but guess that there are other people on the list
> which are, maybe they could suggest some useful techniques.

Extensive documentation about how to configure various e-mail clients
for sending kernel patches can be found here:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.31.y.git;a=blob;f=Documentation/email-clients.txt;h=a618efab7b156658be70b29c1a6a9b9c4093e0f5;hb=HEAD.

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OPENSM] match functions to prototypes in header file
  2009-10-01 18:31   ` [OPENSM] match functions to prototypes in header file Sasha Khapyorsky
  2009-10-01 18:33     ` Bart Van Assche
@ 2009-10-01 18:51     ` Jason Gunthorpe
       [not found]       ` <20091001185148.GJ19540-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  2009-10-01 19:30     ` Smith, Stan
  2 siblings, 1 reply; 8+ messages in thread
From: Jason Gunthorpe @ 2009-10-01 18:51 UTC (permalink / raw)
  To: Sasha Khapyorsky
  Cc: Stan C. Smith, ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5, linux-rdma,
	Sean Hefty

On Thu, Oct 01, 2009 at 08:31:27PM +0200, Sasha Khapyorsky wrote:
> > @@ -1106,9 +1109,9 @@ void osm_dump_path_record(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr,
> >  			"\t\t\t\tresv2...................0x%X\n"
> >  			"\t\t\t\tresv3...................0x%X\n",
> >  			cl_ntoh64(p_pr->service_id),
> > -			inet_ntop(AF_INET6, p_pr->dgid.raw, gid_str,
> > +			inet_ntop(AF_INET6, (void*)p_pr->dgid.raw, gid_str,
> 
> And why is such casting(s) needed?

Casting away const like that is incorrect, fix your inet_ntop to have
a POSIX signature or ignore the warning.

> Also wouldn't it be simpler to remove 'const' in "type * const var"
> function parameter definitions? This restricts only value of a pointer
> (not structure content), and since function parameters are passed by
> values such restriction is only related to a function implementation
> and actually meanless in sense of API. Thoughts?

Yah, type * const var is quite strange. Why propose this?

Then again, this existing is quite strange too:

> >  			  IN const osm_log_level_t log_level)

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [OPENSM] match functions to prototypes in header file
  2009-10-01 18:33     ` Bart Van Assche
@ 2009-10-01 19:06       ` Sean Hefty
  0 siblings, 0 replies; 8+ messages in thread
From: Sean Hefty @ 2009-10-01 19:06 UTC (permalink / raw)
  To: 'Bart Van Assche', Sasha Khapyorsky; +Cc: ofw, linux-rdma

>Extensive documentation about how to configure various e-mail clients
>for sending kernel patches can be found here:
>http://git.kernel.org/?p=linux/kernel/git/stable/linux-
>2.6.31.y.git;a=blob;f=Documentation/email-
>clients.txt;h=a618efab7b156658be70b29c1a6a9b9c4093e0f5;hb=HEAD.

Stan,

under Tools - Options - Mail Format - Internet Format, set the line wrap to
something big (132 is max) to avoid wrapping.  When inserting the patch into the
message, select Insert - File - select the file - click the down arrow on the
right side of the Insert button - select Insert as Text.  This avoids copy-paste
issues.

Now, if someone knows how to fix threading with Outlook...

- Sean

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [OPENSM] match functions to prototypes in header file
  2009-10-01 18:31   ` [OPENSM] match functions to prototypes in header file Sasha Khapyorsky
  2009-10-01 18:33     ` Bart Van Assche
  2009-10-01 18:51     ` Jason Gunthorpe
@ 2009-10-01 19:30     ` Smith, Stan
       [not found]       ` <3F6F638B8D880340AB536D29CD4C1E1912C86E88D1-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  2 siblings, 1 reply; 8+ messages in thread
From: Smith, Stan @ 2009-10-01 19:30 UTC (permalink / raw)
  To: Sasha Khapyorsky
  Cc: ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org, linux-rdma,
	Hefty, Sean

Sasha Khapyorsky wrote:
<snip...>
>> @@ -1080,7 +1082,8 @@ void osm_dump_node_record(IN osm_log_t * p_log,
>>
>>  /**********************************************************************
>>
>> **********************************************************************/
>> -void osm_dump_path_record(IN osm_log_t * p_log, IN const
>> ib_path_rec_t * p_pr, +void osm_dump_path_record(IN osm_log_t *
>>                        const p_log, +                          IN const ib_path_rec_t * const p_pr, IN
>>  const osm_log_level_t log_level) {
>>      if (osm_log_is_active(p_log, log_level)) {
>> @@ -1106,9 +1109,9 @@ void osm_dump_path_record(IN osm_log_t *
>>                      p_log, IN const ib_path_rec_t * p_pr,
>>                      "\t\t\t\tresv2...................0x%X\n"
>>                      "\t\t\t\tresv3...................0x%X\n",
>> cl_ntoh64(p_pr->service_id), -                       inet_ntop(AF_INET6, p_pr->dgid.raw,
>> gid_str, +                   inet_ntop(AF_INET6, (void*)p_pr->dgid.raw, gid_str,
>
> And why is such casting(s) needed?

The '(void *)' on inet_ntop() was the only way I could get the MS compiler warnings about differing const types to go away;
(const void *) failed.
Since suppression of information is the preferred modus operandi, I'll see if I can figure out a way to suppress the warning.

>
> Also wouldn't it be simpler to remove 'const' in "type * const var"
> function parameter definitions? This restricts only value of a pointer
> (not structure content), and since function parameters are passed by
> values such restriction is only related to a function implementation
> and actually meanless in sense of API. Thoughts?

I'm just the messenger here, making the function match the prototype.
Fine by me if you choose to change both.

Stan.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [OPENSM] match functions to prototypes in header file
       [not found]       ` <20091001185148.GJ19540-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2009-10-01 19:52         ` Sean Hefty
       [not found]           ` <4D838DBAE5F245EEA72D4466987294E1-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Sean Hefty @ 2009-10-01 19:52 UTC (permalink / raw)
  To: 'Jason Gunthorpe', Sasha Khapyorsky
  Cc: Smith, Stan, ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5, linux-rdma

>> > @@ -1106,9 +1109,9 @@ void osm_dump_path_record(IN osm_log_t * p_log, IN
>const ib_path_rec_t * p_pr,
>> >  			"\t\t\t\tresv2...................0x%X\n"
>> >  			"\t\t\t\tresv3...................0x%X\n",
>> >  			cl_ntoh64(p_pr->service_id),
>> > -			inet_ntop(AF_INET6, p_pr->dgid.raw, gid_str,
>> > +			inet_ntop(AF_INET6, (void*)p_pr->dgid.raw, gid_str,
>>
>> And why is such casting(s) needed?
>
>Casting away const like that is incorrect, fix your inet_ntop to have
>a POSIX signature or ignore the warning.

The WinOF version of inet_ntop is:

const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt);

The MS version of inet_ntop (available in vista and later) is:

"The ANSI version of this function is inet_ntop"
PCTSTR WSAAPI InetNtop(
  __in   INT  Family,
  __in   PVOID pAddr,
  __out  PTSTR pStringBuf,
  __in   size_t StringBufSize
);

I'm guessing inet_ntop maps directly to InetNtop, but I can't find the
definition in the header file.  We use the MS version of the function when
available.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OPENSM] match functions to prototypes in header file
       [not found]           ` <4D838DBAE5F245EEA72D4466987294E1-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
@ 2009-10-01 20:13             ` Jason Gunthorpe
  0 siblings, 0 replies; 8+ messages in thread
From: Jason Gunthorpe @ 2009-10-01 20:13 UTC (permalink / raw)
  To: Sean Hefty
  Cc: Sasha Khapyorsky, Smith, Stan,
	ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5, linux-rdma

On Thu, Oct 01, 2009 at 12:52:21PM -0700, Sean Hefty wrote:
> >> > @@ -1106,9 +1109,9 @@ void osm_dump_path_record(IN osm_log_t * p_log, IN
> >const ib_path_rec_t * p_pr,
> >> >  			"\t\t\t\tresv2...................0x%X\n"
> >> >  			"\t\t\t\tresv3...................0x%X\n",
> >> >  			cl_ntoh64(p_pr->service_id),
> >> > -			inet_ntop(AF_INET6, p_pr->dgid.raw, gid_str,
> >> > +			inet_ntop(AF_INET6, (void*)p_pr->dgid.raw, gid_str,
> >>
> >> And why is such casting(s) needed?
> >
> >Casting away const like that is incorrect, fix your inet_ntop to have
> >a POSIX signature or ignore the warning.
> 
> The WinOF version of inet_ntop is:
> 
> const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt);
> 
> The MS version of inet_ntop (available in vista and later) is:
> 
> "The ANSI version of this function is inet_ntop"
> PCTSTR WSAAPI InetNtop(
>   __in   INT  Family,
>   __in   PVOID pAddr,
>   __out  PTSTR pStringBuf,
>   __in   size_t StringBufSize
> );
> 
> I'm guessing inet_ntop maps directly to InetNtop, but I can't find the
> definition in the header file.  We use the MS version of the function when
> available.

Well, if windows header files are providing inet_ntop with the wrong
signature you are kinda stuck, pretty crummy thing for MS to do really.

I've fixed things like this via this approach before:

#include <windows-header.h>
#define inet_ntop my_inet_ntop
static inline const char *my_inet_ntop(int af, const void *src,
                                       char *dst, socklen_t size)
{
   return InetNtop(af,(void *)src,dst,size);
}

With #include_next it can be pretty transparent.

Hey, I ran into this the other day:

http://www.gnu.org/software/gnulib/

I wonder if it is something that might help your efforts?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] opensm/osm_helper: remove meanless 'const' keywords
       [not found]       ` <3F6F638B8D880340AB536D29CD4C1E1912C86E88D1-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2009-10-01 20:22         ` Sasha Khapyorsky
  0 siblings, 0 replies; 8+ messages in thread
From: Sasha Khapyorsky @ 2009-10-01 20:22 UTC (permalink / raw)
  To: Smith, Stan, linux-rdma
  Cc: ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org,
	Hefty, Sean, Jason Gunthorpe


In APIs remove meanless 'const' keywords related to function parameter
values. Such as:

type func(..., type * const ptr, ..., type const var, ... )

Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---

On 12:30 Thu 01 Oct     , Smith, Stan wrote:
> >
> > Also wouldn't it be simpler to remove 'const' in "type * const var"
> > function parameter definitions? This restricts only value of a pointer
> > (not structure content), and since function parameters are passed by
> > values such restriction is only related to a function implementation
> > and actually meanless in sense of API. Thoughts?
> 
> I'm just the messenger here, making the function match the prototype.
> Fine by me if you choose to change both.

This is a "pilot" for such cleanup. Hope it works for you.

 opensm/include/opensm/osm_helper.h |  211 +++++++++++++++---------------------
 opensm/opensm/osm_helper.c         |   66 ++++++------
 2 files changed, 121 insertions(+), 156 deletions(-)

diff --git a/opensm/include/opensm/osm_helper.h b/opensm/include/opensm/osm_helper.h
index d76af8d..ddca69b 100644
--- a/opensm/include/opensm/osm_helper.h
+++ b/opensm/include/opensm/osm_helper.h
@@ -209,12 +209,10 @@ static inline boolean_t ib_gid_is_notzero(IN const ib_gid_t * p_gid)
 *
 * SYNOPSIS
 */
-void osm_dump_port_info(IN osm_log_t * const p_log,
-			IN const ib_net64_t node_guid,
-			IN const ib_net64_t port_guid,
-			IN const uint8_t port_num,
-			IN const ib_port_info_t * const p_pi,
-			IN const osm_log_level_t log_level);
+void osm_dump_port_info(IN osm_log_t * p_log, IN ib_net64_t node_guid,
+			IN ib_net64_t port_guid, IN uint8_t port_num,
+			IN const ib_port_info_t * p_pi,
+			IN osm_log_level_t log_level);
 /*
 * PARAMETERS
 *	p_log
@@ -243,89 +241,66 @@ void osm_dump_port_info(IN osm_log_t * const p_log,
 * SEE ALSO
 *********/
 
-void
-osm_dump_path_record(IN osm_log_t * const p_log,
-		     IN const ib_path_rec_t * const p_pr,
-		     IN const osm_log_level_t log_level);
-
-void
-osm_dump_multipath_record(IN osm_log_t * const p_log,
-			  IN const ib_multipath_rec_t * const p_mpr,
-			  IN const osm_log_level_t log_level);
-
-void
-osm_dump_node_record(IN osm_log_t * const p_log,
-		     IN const ib_node_record_t * const p_nr,
-		     IN const osm_log_level_t log_level);
-
-void
-osm_dump_mc_record(IN osm_log_t * const p_log,
-		   IN const ib_member_rec_t * const p_mcmr,
-		   IN const osm_log_level_t log_level);
-
-void
-osm_dump_link_record(IN osm_log_t * const p_log,
-		     IN const ib_link_record_t * const p_lr,
-		     IN const osm_log_level_t log_level);
-
-void
-osm_dump_service_record(IN osm_log_t * const p_log,
-			IN const ib_service_record_t * const p_sr,
-			IN const osm_log_level_t log_level);
-
-void
-osm_dump_portinfo_record(IN osm_log_t * const p_log,
-			 IN const ib_portinfo_record_t * const p_pir,
-			 IN const osm_log_level_t log_level);
-
-void
-osm_dump_guidinfo_record(IN osm_log_t * const p_log,
-			 IN const ib_guidinfo_record_t * const p_gir,
-			 IN const osm_log_level_t log_level);
-
-void
-osm_dump_inform_info(IN osm_log_t * const p_log,
-		     IN const ib_inform_info_t * const p_ii,
-		     IN const osm_log_level_t log_level);
-
-void
-osm_dump_inform_info_record(IN osm_log_t * const p_log,
-			    IN const ib_inform_info_record_t * const p_iir,
-			    IN const osm_log_level_t log_level);
-
-void
-osm_dump_switch_info_record(IN osm_log_t * const p_log,
-			    IN const ib_switch_info_record_t * const p_sir,
-			    IN const osm_log_level_t log_level);
-
-void
-osm_dump_sm_info_record(IN osm_log_t * const p_log,
-			IN const ib_sminfo_record_t * const p_smir,
-			IN const osm_log_level_t log_level);
-
-void
-osm_dump_pkey_block(IN osm_log_t * const p_log,
-		    IN uint64_t port_guid,
-		    IN uint16_t block_num,
-		    IN uint8_t port_num,
-		    IN const ib_pkey_table_t * const p_pkey_tbl,
-		    IN const osm_log_level_t log_level);
-
-void
-osm_dump_slvl_map_table(IN osm_log_t * const p_log,
-			IN uint64_t port_guid,
-			IN uint8_t in_port_num,
-			IN uint8_t out_port_num,
-			IN const ib_slvl_table_t * const p_slvl_tbl,
-			IN const osm_log_level_t log_level);
-
-void
-osm_dump_vl_arb_table(IN osm_log_t * const p_log,
-		      IN uint64_t port_guid,
-		      IN uint8_t block_num,
-		      IN uint8_t port_num,
-		      IN const ib_vl_arb_table_t * const p_vla_tbl,
-		      IN const osm_log_level_t log_level);
+void osm_dump_path_record(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr,
+			  IN osm_log_level_t log_level);
+
+void osm_dump_multipath_record(IN osm_log_t * p_log,
+			       IN const ib_multipath_rec_t * p_mpr,
+			       IN osm_log_level_t log_level);
+
+void osm_dump_node_record(IN osm_log_t * p_log,
+			  IN const ib_node_record_t * p_nr,
+			  IN osm_log_level_t log_level);
+
+void osm_dump_mc_record(IN osm_log_t * p_log, IN const ib_member_rec_t * p_mcmr,
+			IN osm_log_level_t log_level);
+
+void osm_dump_link_record(IN osm_log_t * p_log,
+			  IN const ib_link_record_t * p_lr,
+			  IN osm_log_level_t log_level);
+
+void osm_dump_service_record(IN osm_log_t * p_log,
+			     IN const ib_service_record_t * p_sr,
+			     IN osm_log_level_t log_level);
+
+void osm_dump_portinfo_record(IN osm_log_t * p_log,
+			      IN const ib_portinfo_record_t * p_pir,
+			      IN osm_log_level_t log_level);
+
+void osm_dump_guidinfo_record(IN osm_log_t * p_log,
+			      IN const ib_guidinfo_record_t * p_gir,
+			      IN osm_log_level_t log_level);
+
+void osm_dump_inform_info(IN osm_log_t * p_log,
+			  IN const ib_inform_info_t * p_ii,
+			  IN osm_log_level_t log_level);
+
+void osm_dump_inform_info_record(IN osm_log_t * p_log,
+				 IN const ib_inform_info_record_t * p_iir,
+				 IN osm_log_level_t log_level);
+
+void osm_dump_switch_info_record(IN osm_log_t * p_log,
+				 IN const ib_switch_info_record_t * p_sir,
+				 IN osm_log_level_t log_level);
+
+void osm_dump_sm_info_record(IN osm_log_t * p_log,
+			     IN const ib_sminfo_record_t * p_smir,
+			     IN osm_log_level_t log_level);
+
+void osm_dump_pkey_block(IN osm_log_t * p_log, IN uint64_t port_guid,
+			 IN uint16_t block_num, IN uint8_t port_num,
+			 IN const ib_pkey_table_t * p_pkey_tbl,
+			 IN osm_log_level_t log_level);
+
+void osm_dump_slvl_map_table(IN osm_log_t * p_log, IN uint64_t port_guid,
+			     IN uint8_t in_port_num, IN uint8_t out_port_num,
+			     IN const ib_slvl_table_t * p_slvl_tbl,
+			     IN osm_log_level_t log_level);
+
+void osm_dump_vl_arb_table(IN osm_log_t * p_log, IN uint64_t port_guid,
+			   IN uint8_t block_num, IN uint8_t port_num,
+			   IN const ib_vl_arb_table_t * p_vla_tbl,
+			   IN osm_log_level_t log_level);
 
 /****f* OpenSM: Helper/osm_dump_port_info
 * NAME
@@ -336,9 +311,9 @@ osm_dump_vl_arb_table(IN osm_log_t * const p_log,
 *
 * SYNOPSIS
 */
-void osm_dump_node_info(IN osm_log_t * const p_log,
-			IN const ib_node_info_t * const p_ni,
-			IN const osm_log_level_t log_level);
+void osm_dump_node_info(IN osm_log_t * p_log,
+			IN const ib_node_info_t * p_ni,
+			IN osm_log_level_t log_level);
 /*
 * PARAMETERS
 *	p_log
@@ -367,10 +342,8 @@ void osm_dump_node_info(IN osm_log_t * const p_log,
 *
 * SYNOPSIS
 */
-void
-osm_dump_sm_info(IN osm_log_t * const p_log,
-		 IN const ib_sm_info_t * const p_smi,
-		 IN const osm_log_level_t log_level);
+void osm_dump_sm_info(IN osm_log_t * p_log, IN const ib_sm_info_t * p_smi,
+		      IN osm_log_level_t log_level);
 /*
 * PARAMETERS
 *	p_log
@@ -399,10 +372,9 @@ osm_dump_sm_info(IN osm_log_t * const p_log,
 *
 * SYNOPSIS
 */
-void
-osm_dump_switch_info(IN osm_log_t * const p_log,
-		     IN const ib_switch_info_t * const p_si,
-		     IN const osm_log_level_t log_level);
+void osm_dump_switch_info(IN osm_log_t * p_log,
+			  IN const ib_switch_info_t * p_si,
+			  IN osm_log_level_t log_level);
 /*
 * PARAMETERS
 *	p_log
@@ -431,10 +403,9 @@ osm_dump_switch_info(IN osm_log_t * const p_log,
 *
 * SYNOPSIS
 */
-void
-osm_dump_notice(IN osm_log_t * const p_log,
-		IN const ib_mad_notice_attr_t * p_ntci,
-		IN const osm_log_level_t log_level);
+void osm_dump_notice(IN osm_log_t * p_log,
+		     IN const ib_mad_notice_attr_t * p_ntci,
+		     IN osm_log_level_t log_level);
 /*
 * PARAMETERS
 *	p_log
@@ -477,21 +448,17 @@ const char *osm_get_disp_msg_str(IN cl_disp_msgid_t msg);
 * SEE ALSO
 *********/
 
-void osm_dump_dr_path(IN osm_log_t * const p_log,
-		      IN const osm_dr_path_t * const p_path,
-		      IN const osm_log_level_t level);
+void osm_dump_dr_path(IN osm_log_t * p_log, IN const osm_dr_path_t * p_path,
+		      IN osm_log_level_t level);
 
-void osm_dump_smp_dr_path(IN osm_log_t * const p_log,
-			  IN const ib_smp_t * const p_smp,
-			  IN const osm_log_level_t level);
+void osm_dump_smp_dr_path(IN osm_log_t * p_log, IN const ib_smp_t * p_smp,
+			  IN osm_log_level_t level);
 
-void osm_dump_dr_smp(IN osm_log_t * const p_log,
-		     IN const ib_smp_t * const p_smp,
-		     IN const osm_log_level_t level);
+void osm_dump_dr_smp(IN osm_log_t * p_log, IN const ib_smp_t * p_smp,
+		     IN osm_log_level_t level);
 
-void osm_dump_sa_mad(IN osm_log_t * const p_log,
-		     IN const ib_sa_mad_t * const p_smp,
-		     IN const osm_log_level_t level);
+void osm_dump_sa_mad(IN osm_log_t * p_log, IN const ib_sa_mad_t * p_smp,
+		     IN osm_log_level_t level);
 
 /****f* IBA Base: Types/osm_get_sm_signal_str
 * NAME
@@ -520,17 +487,17 @@ const char *osm_get_port_state_str_fixed_width(IN uint8_t port_state);
 
 const char *osm_get_node_type_str_fixed_width(IN uint8_t node_type);
 
-const char *osm_get_manufacturer_str(IN uint64_t const guid_ho);
+const char *osm_get_manufacturer_str(IN uint64_t guid_ho);
 
-const char *osm_get_mtu_str(IN uint8_t const mtu);
+const char *osm_get_mtu_str(IN uint8_t mtu);
 
-const char *osm_get_lwa_str(IN uint8_t const lwa);
+const char *osm_get_lwa_str(IN uint8_t lwa);
 
-const char *osm_get_mtu_str(IN uint8_t const mtu);
+const char *osm_get_mtu_str(IN uint8_t mtu);
 
-const char *osm_get_lwa_str(IN uint8_t const lwa);
+const char *osm_get_lwa_str(IN uint8_t lwa);
 
-const char *osm_get_lsa_str(IN uint8_t const lsa);
+const char *osm_get_lsa_str(IN uint8_t lsa);
 
 /****f* IBA Base: Types/osm_get_sm_mgr_signal_str
 * NAME
diff --git a/opensm/opensm/osm_helper.c b/opensm/opensm/osm_helper.c
index ea9e21f..2f45279 100644
--- a/opensm/opensm/osm_helper.c
+++ b/opensm/opensm/osm_helper.c
@@ -552,8 +552,7 @@ const ib_gid_t ib_zero_gid = { { 0 } };
 
 /**********************************************************************
  **********************************************************************/
-static ib_api_status_t dbg_do_line(IN char **pp_local,
-				   IN const uint32_t buf_size,
+static ib_api_status_t dbg_do_line(IN char **pp_local, IN uint32_t buf_size,
 				   IN const char *p_prefix_str,
 				   IN const char *p_new_str,
 				   IN uint32_t * p_total_len)
@@ -574,7 +573,7 @@ static ib_api_status_t dbg_do_line(IN char **pp_local,
 
 /**********************************************************************
  **********************************************************************/
-static void dbg_get_capabilities_str(IN char *p_buf, IN const uint32_t buf_size,
+static void dbg_get_capabilities_str(IN char *p_buf, IN uint32_t buf_size,
 				     IN const char *p_prefix_str,
 				     IN const ib_port_info_t * p_pi)
 {
@@ -780,11 +779,10 @@ static void dbg_get_capabilities_str(IN char *p_buf, IN const uint32_t buf_size,
 
 /**********************************************************************
  **********************************************************************/
-void osm_dump_port_info(IN osm_log_t * p_log, IN const ib_net64_t node_guid,
-			IN const ib_net64_t port_guid,
-			IN const uint8_t port_num,
+void osm_dump_port_info(IN osm_log_t * p_log, IN ib_net64_t node_guid,
+			IN ib_net64_t port_guid, IN uint8_t port_num,
 			IN const ib_port_info_t * p_pi,
-			IN const osm_log_level_t log_level)
+			IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		char buf[BUF_SIZE];
@@ -872,7 +870,7 @@ void osm_dump_port_info(IN osm_log_t * p_log, IN const ib_net64_t node_guid,
  **********************************************************************/
 void osm_dump_portinfo_record(IN osm_log_t * p_log,
 			      IN const ib_portinfo_record_t * p_pir,
-			      IN const osm_log_level_t log_level)
+			      IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		char buf[BUF_SIZE];
@@ -958,7 +956,7 @@ void osm_dump_portinfo_record(IN osm_log_t * p_log,
  **********************************************************************/
 void osm_dump_guidinfo_record(IN osm_log_t * p_log,
 			      IN const ib_guidinfo_record_t * p_gir,
-			      IN const osm_log_level_t log_level)
+			      IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		const ib_guid_info_t *p_gi = &p_gir->guid_info;
@@ -996,7 +994,7 @@ void osm_dump_guidinfo_record(IN osm_log_t * p_log,
 /**********************************************************************
  **********************************************************************/
 void osm_dump_node_info(IN osm_log_t * p_log, IN const ib_node_info_t * p_ni,
-			IN const osm_log_level_t log_level)
+			IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		osm_log(p_log, log_level,
@@ -1032,7 +1030,7 @@ void osm_dump_node_info(IN osm_log_t * p_log, IN const ib_node_info_t * p_ni,
  **********************************************************************/
 void osm_dump_node_record(IN osm_log_t * p_log,
 			  IN const ib_node_record_t * p_nr,
-			  IN const osm_log_level_t log_level)
+			  IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		char desc[sizeof(p_nr->node_desc.description) + 1];
@@ -1081,7 +1079,7 @@ void osm_dump_node_record(IN osm_log_t * p_log,
 /**********************************************************************
  **********************************************************************/
 void osm_dump_path_record(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr,
-			  IN const osm_log_level_t log_level)
+			  IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		char gid_str[INET6_ADDRSTRLEN];
@@ -1131,7 +1129,7 @@ void osm_dump_path_record(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr,
  **********************************************************************/
 void osm_dump_multipath_record(IN osm_log_t * p_log,
 			       IN const ib_multipath_rec_t * p_mpr,
-			       IN const osm_log_level_t log_level)
+			       IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		char gid_str[INET6_ADDRSTRLEN];
@@ -1194,7 +1192,7 @@ void osm_dump_multipath_record(IN osm_log_t * p_log,
 /**********************************************************************
  **********************************************************************/
 void osm_dump_mc_record(IN osm_log_t * p_log, IN const ib_member_rec_t * p_mcmr,
-			IN const osm_log_level_t log_level)
+			IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		char gid_str[INET6_ADDRSTRLEN];
@@ -1233,7 +1231,7 @@ void osm_dump_mc_record(IN osm_log_t * p_log, IN const ib_member_rec_t * p_mcmr,
  **********************************************************************/
 void osm_dump_service_record(IN osm_log_t * p_log,
 			     IN const ib_service_record_t * p_sr,
-			     IN const osm_log_level_t log_level)
+			     IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		char gid_str[INET6_ADDRSTRLEN];
@@ -1334,7 +1332,7 @@ void osm_dump_service_record(IN osm_log_t * p_log,
  **********************************************************************/
 void osm_dump_inform_info(IN osm_log_t * p_log,
 			  IN const ib_inform_info_t * p_ii,
-			  IN const osm_log_level_t log_level)
+			  IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		uint32_t qpn;
@@ -1395,7 +1393,7 @@ void osm_dump_inform_info(IN osm_log_t * p_log,
  **********************************************************************/
 void osm_dump_inform_info_record(IN osm_log_t * p_log,
 				 IN const ib_inform_info_record_t * p_iir,
-				 IN const osm_log_level_t log_level)
+				 IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		char gid_str[INET6_ADDRSTRLEN];
@@ -1478,7 +1476,7 @@ void osm_dump_inform_info_record(IN osm_log_t * p_log,
  **********************************************************************/
 void osm_dump_link_record(IN osm_log_t * p_log,
 			  IN const ib_link_record_t * p_lr,
-			  IN const osm_log_level_t log_level)
+			  IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		osm_log(p_log, log_level,
@@ -1497,7 +1495,7 @@ void osm_dump_link_record(IN osm_log_t * p_log,
  **********************************************************************/
 void osm_dump_switch_info(IN osm_log_t * p_log,
 			  IN const ib_switch_info_t * p_si,
-			  IN const osm_log_level_t log_level)
+			  IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		osm_log(p_log, OSM_LOG_VERBOSE,
@@ -1532,7 +1530,7 @@ void osm_dump_switch_info(IN osm_log_t * p_log,
  **********************************************************************/
 void osm_dump_switch_info_record(IN osm_log_t * p_log,
 				 IN const ib_switch_info_record_t * p_sir,
-				 IN const osm_log_level_t log_level)
+				 IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		osm_log(p_log, log_level,
@@ -1571,7 +1569,7 @@ void osm_dump_switch_info_record(IN osm_log_t * p_log,
 void osm_dump_pkey_block(IN osm_log_t * p_log, IN uint64_t port_guid,
 			 IN uint16_t block_num, IN uint8_t port_num,
 			 IN const ib_pkey_table_t * p_pkey_tbl,
-			 IN const osm_log_level_t log_level)
+			 IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		char buf_line[1024];
@@ -1595,7 +1593,7 @@ void osm_dump_pkey_block(IN osm_log_t * p_log, IN uint64_t port_guid,
 void osm_dump_slvl_map_table(IN osm_log_t * p_log, IN uint64_t port_guid,
 			     IN uint8_t in_port_num, IN uint8_t out_port_num,
 			     IN const ib_slvl_table_t * p_slvl_tbl,
-			     IN const osm_log_level_t log_level)
+			     IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		char buf_line1[1024], buf_line2[1024];
@@ -1622,7 +1620,7 @@ void osm_dump_slvl_map_table(IN osm_log_t * p_log, IN uint64_t port_guid,
 void osm_dump_vl_arb_table(IN osm_log_t * p_log, IN uint64_t port_guid,
 			   IN uint8_t block_num, IN uint8_t port_num,
 			   IN const ib_vl_arb_table_t * p_vla_tbl,
-			   IN const osm_log_level_t log_level)
+			   IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		char buf_line1[1024], buf_line2[1024];
@@ -1646,7 +1644,7 @@ void osm_dump_vl_arb_table(IN osm_log_t * p_log, IN uint64_t port_guid,
 /**********************************************************************
  **********************************************************************/
 void osm_dump_sm_info(IN osm_log_t * p_log, IN const ib_sm_info_t * p_smi,
-		      IN const osm_log_level_t log_level)
+		      IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		osm_log(p_log, OSM_LOG_DEBUG,
@@ -1668,7 +1666,7 @@ void osm_dump_sm_info(IN osm_log_t * p_log, IN const ib_sm_info_t * p_smi,
  **********************************************************************/
 void osm_dump_sm_info_record(IN osm_log_t * p_log,
 			     IN const ib_sminfo_record_t * p_smir,
-			     IN const osm_log_level_t log_level)
+			     IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		osm_log(p_log, OSM_LOG_DEBUG,
@@ -1696,7 +1694,7 @@ void osm_dump_sm_info_record(IN osm_log_t * p_log,
  **********************************************************************/
 void osm_dump_notice(IN osm_log_t * p_log,
 		     IN const ib_mad_notice_attr_t * p_ntci,
-		     IN const osm_log_level_t log_level)
+		     IN osm_log_level_t log_level)
 {
 	if (!osm_log_is_active(p_log, log_level))
 		return;
@@ -1890,7 +1888,7 @@ void osm_dump_notice(IN osm_log_t * p_log,
 /**********************************************************************
  **********************************************************************/
 void osm_dump_dr_smp(IN osm_log_t * p_log, IN const ib_smp_t * p_smp,
-		     IN const osm_log_level_t log_level)
+		     IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		char buf[BUF_SIZE];
@@ -1997,7 +1995,7 @@ void osm_dump_dr_smp(IN osm_log_t * p_log, IN const ib_smp_t * p_smp,
 /**********************************************************************
  **********************************************************************/
 void osm_dump_sa_mad(IN osm_log_t * p_log, IN const ib_sa_mad_t * p_mad,
-		     IN const osm_log_level_t log_level)
+		     IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		char buf[BUF_SIZE];
@@ -2060,7 +2058,7 @@ void osm_dump_sa_mad(IN osm_log_t * p_log, IN const ib_sa_mad_t * p_mad,
 /**********************************************************************
  **********************************************************************/
 void osm_dump_dr_path(IN osm_log_t * p_log, IN const osm_dr_path_t * p_path,
-		      IN const osm_log_level_t log_level)
+		      IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		char buf[BUF_SIZE];
@@ -2078,7 +2076,7 @@ void osm_dump_dr_path(IN osm_log_t * p_log, IN const osm_dr_path_t * p_path,
 /**********************************************************************
  **********************************************************************/
 void osm_dump_smp_dr_path(IN osm_log_t * p_log, IN const ib_smp_t * p_smp,
-			  IN const osm_log_level_t log_level)
+			  IN osm_log_level_t log_level)
 {
 	if (osm_log_is_active(p_log, log_level)) {
 		char buf[BUF_SIZE];
@@ -2200,7 +2198,7 @@ const char *osm_get_node_type_str_fixed_width(IN uint8_t node_type)
 
 /**********************************************************************
  **********************************************************************/
-const char *osm_get_manufacturer_str(IN uint64_t const guid_ho)
+const char *osm_get_manufacturer_str(IN uint64_t guid_ho)
 {
 	/* note that the max vendor string length is 11 */
 	static const char *intel_str = "Intel";
@@ -2300,7 +2298,7 @@ static const char *mtu_str_fixed_width[] = {
 
 /**********************************************************************
  **********************************************************************/
-const char *osm_get_mtu_str(IN uint8_t const mtu)
+const char *osm_get_mtu_str(IN uint8_t mtu)
 {
 	if (mtu > IB_MTU_LEN_4096)
 		return (mtu_str_fixed_width[0]);
@@ -2322,7 +2320,7 @@ static const char *lwa_str_fixed_width[] = {
 
 /**********************************************************************
  **********************************************************************/
-const char *osm_get_lwa_str(IN uint8_t const lwa)
+const char *osm_get_lwa_str(IN uint8_t lwa)
 {
 	if (lwa > 8)
 		return (lwa_str_fixed_width[0]);
@@ -2340,7 +2338,7 @@ static const char *lsa_str_fixed_width[] = {
 	"10 "
 };
 
-const char *osm_get_lsa_str(IN uint8_t const lsa)
+const char *osm_get_lsa_str(IN uint8_t lsa)
 {
 	if (lsa > 4)
 		return (lsa_str_fixed_width[0]);
-- 
1.6.5.rc1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-10-01 20:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <3DE88517D38A4EB0B49A2E3AAF96D005@amr.corp.intel.com>
     [not found] ` <3DE88517D38A4EB0B49A2E3AAF96D005-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-10-01 18:31   ` [OPENSM] match functions to prototypes in header file Sasha Khapyorsky
2009-10-01 18:33     ` Bart Van Assche
2009-10-01 19:06       ` Sean Hefty
2009-10-01 18:51     ` Jason Gunthorpe
     [not found]       ` <20091001185148.GJ19540-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-01 19:52         ` Sean Hefty
     [not found]           ` <4D838DBAE5F245EEA72D4466987294E1-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-10-01 20:13             ` Jason Gunthorpe
2009-10-01 19:30     ` Smith, Stan
     [not found]       ` <3F6F638B8D880340AB536D29CD4C1E1912C86E88D1-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2009-10-01 20:22         ` [PATCH] opensm/osm_helper: remove meanless 'const' keywords Sasha Khapyorsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.