match functions to prototypes in header file
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 3DE88517D38A4EB0B49A2E3AAF96D005-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org
Quoted 3 lines · Stan C. Smith
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.
Quoted 74 lines
Signed-off-by stan smith <[email protected]>opensm/opensm/osm_helper.c +13
-10@@ -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)) {
opensm/opensm/osm_helper.c void osm_dump_path_record(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr, · line 1112
Quoted 5 lines
opensm/opensm/osm_helper.c +1
-1@@ -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
Quoted 308 lines
opensm/opensm/osm_helper.c +50
-45sizeof 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)) {
opensm/opensm/osm_helper.c void osm_dump_dr_path(IN osm_log_t * p_log, IN const osm_dr_path_t * p_path, · line 2092
Quoted 9 lines
opensm/opensm/osm_helper.c +2
-1@@ -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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Sasha Khapyorsky
Quoted 3 lines · Stan C. Smith
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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines
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
Quoted 8 lines · Sasha Khapyorsky
Review void osm_dump_path_record(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr, · line 1112
Quoted 6 lines
(quoted diff) +1
-1@@ -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.
Quoted 5 lines
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:
Quoted 1 line
Review void osm_dump_path_record(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr, · line 1113
Quoted 1 line
(quoted diff) +0
-0IN 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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20091001185148.GJ19540-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org
Quoted 10 lines
Quoted 1 line
Review void osm_dump_path_record(IN osm_log_t * p_log, IN
Quoted 1 line
(quoted diff) +0
-0@@ -1106,9 +1109,9 @@ void osm_dump_path_record(IN osm_log_t * p_log, INconst
ib_path_rec_t*p_pr,Quoted 7 lines
Review void osm_dump_path_record(IN osm_log_t * p_log, IN · line 1112
Quoted 5 lines
(quoted diff) +1
-1"\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?
Quoted 2 lines
Casting away const like that is incorrect, fix your
inet_ntopto 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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 4D838DBAE5F245EEA72D4466987294E1-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org
Quoted 25 lines · Sean Hefty
Quoted 10 lines
Quoted 1 line
Review void osm_dump_path_record(IN osm_log_t * p_log, IN
Quoted 1 line
(quoted diff) +0
-0@@ -1106,9 +1109,9 @@ void osm_dump_path_record(IN osm_log_t * p_log, INconst
ib_path_rec_t*p_pr,Quoted 7 lines
Review void osm_dump_path_record(IN osm_log_t * p_log, IN · line 1112
Quoted 5 lines
(quoted diff) +1
-1"\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?
Quoted 2 lines
Casting away const like that is incorrect, fix your
inet_ntopto have a POSIX signature or ignore the warning.The WinOF version of
inet_ntopis:const char *inet_ntop(int af, const void *src, char *dst,
socklen_tcnt);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
Quoted 5 lines
);
I'm guessing
inet_ntopmaps 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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Sasha Khapyorsky wrote:
<snip...>
Quoted 4 lines
Quoted 4 lines
(quoted diff) +0
-0@@ -1080,7 +1082,8 @@ void osm_dump_node_record(IN osm_log_t * p_log, /**********************************************************************
Quoted 14 lines
Review void osm_dump_path_record(IN osm_log_t * · line 1113
Quoted 12 lines
(quoted diff) +0
-1**********************************************************************/ -void osm_dump_path_record(IN osm_log_t * p_log, IN const
ib_path_rec_t*p_pr, +void osm_dump_path_record(INosm_log_t*
constp_log, + IN constib_path_rec_t* constp_pr, INconst osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) {(quoted diff) +0
-0@@ -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.
Quoted 6 lines
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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 3F6F638B8D880340AB536D29CD4C1E1912C86E88D1-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org
PATCH 1/1 opensm/osm_helper: remove meanless 'const' keywords
In APIs remove meanless 'const' keywords related to function parameter values. Such as:
type func(..., type * const ptr, ..., type const var, ... )
---
Quoted 9 lines · Stan
Quoted 6 lines
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(-)
opensm/include/opensm/osm_helper.h +89 -122
@@ -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
opensm/opensm/osm_helper.c +32 -34
247 lines not on this page · raw message
Signature · 6 lines
1.6.5.rc1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html