[openib-general] [PATCH] opensm: x86_64 related osm_log() format fixes

Sasha Khapyorsky sashak at voltaire.com
Fri Nov 3 07:59:33 PST 2006


x86_64 related osm_log() format fixes. Found with strict format checking
attribute.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 osm/libvendor/osm_vendor_ibumad_sa.c |    2 +-
 osm/opensm/osm_mcast_mgr.c           |    2 +-
 osm/opensm/osm_sa_link_record.c      |    4 ++--
 osm/opensm/osm_sa_multipath_record.c |    8 ++++----
 osm/opensm/osm_sa_path_record.c      |    4 ++--
 osm/opensm/osm_state_mgr.c           |    6 +++---
 osm/opensm/osm_ucast_updn.c          |    2 +-
 osm/osmtest/osmtest.c                |   18 +++++++++---------
 8 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/osm/libvendor/osm_vendor_ibumad_sa.c b/osm/libvendor/osm_vendor_ibumad_sa.c
index 7c4a2f7..7ef77de 100644
--- a/osm/libvendor/osm_vendor_ibumad_sa.c
+++ b/osm/libvendor/osm_vendor_ibumad_sa.c
@@ -159,7 +159,7 @@ #else
         ( ( p_madw->mad_size - IB_SA_MAD_HDR_SIZE ) /
           ib_get_attr_size( p_sa_mad->attr_offset ) );
       osm_log( p_bind->p_log, OSM_LOG_DEBUG,
-               "__osmv_sa_mad_rcv_cb: Count = %u = %u / %u (%u)\n",
+               "__osmv_sa_mad_rcv_cb: Count = %u = %zu / %u (%zu)\n",
                query_res.result_cnt, p_madw->mad_size - IB_SA_MAD_HDR_SIZE,
                ib_get_attr_size( p_sa_mad->attr_offset ),
                ( p_madw->mad_size - IB_SA_MAD_HDR_SIZE ) %
diff --git a/osm/opensm/osm_mcast_mgr.c b/osm/opensm/osm_mcast_mgr.c
index 82ef7c3..5cb97be 100644
--- a/osm/opensm/osm_mcast_mgr.c
+++ b/osm/opensm/osm_mcast_mgr.c
@@ -812,7 +812,7 @@ __osm_mcast_mgr_branch(
     {
       osm_log( p_mgr->p_log, OSM_LOG_DEBUG,
                "__osm_mcast_mgr_branch: "
-               "Routing %u destination(s) via switch port 0x%X\n",
+               "Routing %zu destination(s) via switch port 0x%X\n",
                count, i );
     }
 
diff --git a/osm/opensm/osm_sa_link_record.c b/osm/opensm/osm_sa_link_record.c
index 2bc16a3..b4e4aef 100644
--- a/osm/opensm/osm_sa_link_record.c
+++ b/osm/opensm/osm_sa_link_record.c
@@ -568,7 +568,7 @@ #endif
        (num_rec > 1)) {
     osm_log( p_rcv->p_log, OSM_LOG_ERROR,
              "__osm_lr_rcv_respond: ERR 1806: "
-             "Got more than one record for SubnAdmGet (%u)\n",
+             "Got more than one record for SubnAdmGet (%zu)\n",
              num_rec );
     osm_sa_send_error( p_rcv->p_resp, p_madw,
                        IB_SA_MAD_STATUS_TOO_MANY_RECORDS );
@@ -600,7 +600,7 @@ #endif
   {
     osm_log( p_rcv->p_log, OSM_LOG_DEBUG,
              "__osm_lr_rcv_respond: "
-             "Generating response with %u records", num_rec );
+             "Generating response with %zu records", num_rec );
   }
 
   /*
diff --git a/osm/opensm/osm_sa_multipath_record.c b/osm/opensm/osm_sa_multipath_record.c
index 5f70369..0151374 100644
--- a/osm/opensm/osm_sa_multipath_record.c
+++ b/osm/opensm/osm_sa_multipath_record.c
@@ -295,7 +295,7 @@ __osm_mpr_rcv_get_path_parms(
       osm_log( p_rcv->p_log, OSM_LOG_ERROR,
 	       "__osm_mpr_rcv_get_path_parms: ERR 4518: "
 	       "Ports do not share specified PKey 0x%04x\n"
-	       "\t\tsrc %Lx dst %Lx\n",
+	       "\t\tsrc %" PRIx64 " dst %" PRIx64 "\n",
 	       cl_ntoh16( required_pkey ),
 	       cl_ntoh64( osm_physp_get_port_guid( p_physp ) ),
 	       cl_ntoh64( osm_physp_get_port_guid( p_dest_physp ) ) );
@@ -308,7 +308,7 @@ __osm_mpr_rcv_get_path_parms(
       osm_log( p_rcv->p_log, OSM_LOG_ERROR,
                "__osm_mpr_rcv_get_path_parms: ERR 4519: "
                "Ports do not have any shared PKeys\n"
-               "\t\tsrc %Lx dst %Lx\n",
+               "\t\tsrc %" PRIx64 " dst %" PRIx64 "\n",
                cl_ntoh64( osm_physp_get_port_guid( p_physp ) ),
                cl_ntoh64( osm_physp_get_port_guid( p_dest_physp ) ) );
       status = IB_NOT_FOUND;
@@ -529,7 +529,7 @@ __osm_mpr_rcv_get_path_parms(
       if (vl == IB_DROP_VL) {	/* discard packet */
         osm_log( p_rcv->p_log, OSM_LOG_VERBOSE,
                  "__osm_mpr_rcv_get_path_parms: Path not found for SL %d\n"
-		 "\t\tin_port_num %d port_guid %Lx\n",
+		 "\t\tin_port_num %d port_guid %" PRIx64 "\n",
 		 required_sl, in_port_num,
 		 cl_ntoh64( osm_physp_get_port_guid( p_physp ) ) );
         status = IB_NOT_FOUND;
@@ -1467,7 +1467,7 @@ __osm_mpr_rcv_respond(
 
   osm_log( p_rcv->p_log, OSM_LOG_DEBUG,
 	   "__osm_mpr_rcv_respond: "
-	   "Generating response with %u records\n", num_rec );
+	   "Generating response with %zu records\n", num_rec );
 
   mad_size =  IB_SA_MAD_HDR_SIZE + num_rec * sizeof(ib_path_rec_t);
 
diff --git a/osm/opensm/osm_sa_path_record.c b/osm/opensm/osm_sa_path_record.c
index a93ce10..dca3603 100644
--- a/osm/opensm/osm_sa_path_record.c
+++ b/osm/opensm/osm_sa_path_record.c
@@ -1661,7 +1661,7 @@ #endif
     {
       osm_log( p_rcv->p_log, OSM_LOG_ERROR,
                "__osm_pr_rcv_respond: ERR 1F13: "
-               "Got more than one record for SubnAdmGet (%u)\n",
+               "Got more than one record for SubnAdmGet (%zu)\n",
                num_rec );
       osm_sa_send_error( p_rcv->p_resp, p_madw,
                          IB_SA_MAD_STATUS_TOO_MANY_RECORDS );
@@ -1691,7 +1691,7 @@ #endif
 
   osm_log( p_rcv->p_log, OSM_LOG_DEBUG,
            "__osm_pr_rcv_respond: "
-           "Generating response with %u records\n", num_rec );
+           "Generating response with %zu records\n", num_rec );
 
   if ((p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec == 0))
   {
diff --git a/osm/opensm/osm_state_mgr.c b/osm/opensm/osm_state_mgr.c
index 70af836..993b7eb 100644
--- a/osm/opensm/osm_state_mgr.c
+++ b/osm/opensm/osm_state_mgr.c
@@ -1801,7 +1801,7 @@ __osm_state_mgr_check_tbl_consistency(
           * new lid we wanted to give it in our port_lid_tbl. */
          osm_log( p_mgr->p_log, OSM_LOG_ERROR,
                   "__osm_state_mgr_check_tbl_consistency: ERR 3322: "
-                  "lid 0x%X is wrongly assigned to port 0x%016" PRIx64
+                  "lid 0x%zX is wrongly assigned to port 0x%016" PRIx64
                   " in port_lid_tbl\n",
                   lid, cl_ntoh64( osm_port_get_guid( p_port_stored ) ) );
       }
@@ -1815,7 +1815,7 @@ __osm_state_mgr_check_tbl_consistency(
             osm_log( p_mgr->p_log, OSM_LOG_ERROR,
                      "__osm_state_mgr_check_tbl_consistency: ERR 3323: "
                      "port 0x%016" PRIx64 " exists in new port_lid_tbl under "
-                     "lid 0x%X, but missing in subnet port_lid_tbl db\n",
+                     "lid 0x%zX, but missing in subnet port_lid_tbl db\n",
                      cl_ntoh64( osm_port_get_guid( p_port_ref ) ), lid );
          }
          else
@@ -1826,7 +1826,7 @@ __osm_state_mgr_check_tbl_consistency(
              * and p_port_ref also didn't get the lid update. */
             osm_log( p_mgr->p_log, OSM_LOG_ERROR,
                      "__osm_state_mgr_check_tbl_consistency: ERR 3324: "
-                     "lid 0x%X has port 0x%016" PRIx64
+                     "lid 0x%zX has port 0x%016" PRIx64
                      " in new port_lid_tbl db, " "and port 0x%016" PRIx64
                      " in subnet port_lid_tbl db\n", lid,
                      cl_ntoh64( osm_port_get_guid( p_port_ref ) ),
diff --git a/osm/opensm/osm_ucast_updn.c b/osm/opensm/osm_ucast_updn.c
index b2159d3..8abad21 100644
--- a/osm/opensm/osm_ucast_updn.c
+++ b/osm/opensm/osm_ucast_updn.c
@@ -360,7 +360,7 @@ __updn_bfs_by_node(
   {
     osm_log(&(osm.log), OSM_LOG_DEBUG,
             "__updn_bfs_by_node:"
-            "Starting a new iteration with %d elements in current list\n",
+            "Starting a new iteration with %zu elements in current list\n",
             cl_list_count(p_currList));
     /* Init the switch directed list */
     p_nextList = (cl_list_t*)malloc(sizeof(cl_list_t));
diff --git a/osm/osmtest/osmtest.c b/osm/osmtest/osmtest.c
index 345a5c3..7dcc6e9 100644
--- a/osm/osmtest/osmtest.c
+++ b/osm/osmtest/osmtest.c
@@ -2117,7 +2117,7 @@ osmtest_write_all_link_recs( IN osmtest_
   {
     osm_log( &p_osmt->log, OSM_LOG_VERBOSE,
              "osmtest_write_all_link_recs: "
-             "Received %u records\n", num_recs );
+             "Received %zu records\n", num_recs );
   }
 
   result = fprintf( fh, "#\n" "# Link Records\n" "#\n" );
@@ -2264,7 +2264,7 @@ osmtest_write_all_node_recs( IN osmtest_
   {
     osm_log( &p_osmt->log, OSM_LOG_VERBOSE,
               "osmtest_write_all_node_recs: "
-              "Received %u records\n", num_recs );
+              "Received %zu records\n", num_recs );
   }
 
   result = fprintf( fh, "#\n" "# Node Records\n" "#\n" );
@@ -2339,7 +2339,7 @@ osmtest_write_all_port_recs( IN osmtest_
   {
     osm_log( &p_osmt->log, OSM_LOG_VERBOSE,
              "osmtest_write_all_port_recs: "
-             "Received %u records\n", num_recs );
+             "Received %zu records\n", num_recs );
   }
 
   result = fprintf( fh, "#\n" "# PortInfo Records\n" "#\n" );
@@ -2414,7 +2414,7 @@ osmtest_write_all_path_recs(
   {
     osm_log( &p_osmt->log, OSM_LOG_VERBOSE,
              "osmtest_write_all_path_recs: "
-             "Received %u records\n", num_recs );
+             "Received %zu records\n", num_recs );
   }
 
   result = fprintf( fh, "#\n" "# Path Records\n" "#\n" );
@@ -4205,7 +4205,7 @@ osmtest_validate_all_node_recs( IN osmte
   {
     osm_log( &p_osmt->log, OSM_LOG_VERBOSE,
              "osmtest_validate_all_node_recs: "
-             "Received %u records\n", num_recs );
+             "Received %zu records\n", num_recs );
   }
 
   /*
@@ -4290,7 +4290,7 @@ osmtest_validate_all_guidinfo_recs( IN o
   {
     osm_log( &p_osmt->log, OSM_LOG_VERBOSE,
              "osmtest_validate_all_guidinfo_recs: "
-             "Received %u records\n", num_recs );
+             "Received %zu records\n", num_recs );
   }
 
   /* No validation as yet */
@@ -4345,7 +4345,7 @@ osmtest_validate_all_path_recs( IN osmte
   {
     osm_log( &p_osmt->log, OSM_LOG_VERBOSE,
              "osmtest_validate_all_path_recs: "
-             "Received %u records\n", num_recs );
+             "Received %zu records\n", num_recs );
   }
 
   /*
@@ -4849,7 +4849,7 @@ osmtest_validate_single_path_rec_lid_pai
   {
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
              "osmtest_validate_single_path_rec_lid_pair: ERR 0103: "
-             "Too many records. Expected 1, received %u\n", num_recs );
+             "Too many records. Expected 1, received %zu\n", num_recs );
 
     status = IB_ERROR;
   }
@@ -5118,7 +5118,7 @@ osmtest_validate_single_path_rec_guid_pa
 
   num_recs = context.result.result_cnt;
   osm_log( &p_osmt->log, OSM_LOG_VERBOSE,
-           "osmtest_validate_single_path_rec_guid_pair: %u records\n",
+           "osmtest_validate_single_path_rec_guid_pair: %zu records\n",
            num_recs);
 
   for( i = 0; i < num_recs; i++ )
-- 
1.4.3.2.g4bf7





More information about the general mailing list