[ofa-general] [PATCH] opensm: remove casting of ib_smp_get_payload_ptr()

Sasha Khapyorsky sashak at voltaire.com
Sat Feb 28 09:37:17 PST 2009


ib_smp_get_payload_ptr() returns void pointer - casting is not needed.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 opensm/opensm/osm_lin_fwd_rcv.c   |    2 +-
 opensm/opensm/osm_mcast_fwd_rcv.c |    2 +-
 opensm/opensm/osm_node.c          |    4 ++--
 opensm/opensm/osm_node_desc_rcv.c |    2 +-
 opensm/opensm/osm_node_info_rcv.c |   10 +++++-----
 opensm/opensm/osm_pkey_rcv.c      |    2 +-
 opensm/opensm/osm_port_info_rcv.c |    4 ++--
 opensm/opensm/osm_slvl_map_rcv.c  |    2 +-
 opensm/opensm/osm_sw_info_rcv.c   |    6 +++---
 opensm/opensm/osm_switch.c        |    2 +-
 opensm/opensm/osm_vl_arb_rcv.c    |    2 +-
 11 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/opensm/opensm/osm_lin_fwd_rcv.c b/opensm/opensm/osm_lin_fwd_rcv.c
index c3d8633..2edb8d3 100644
--- a/opensm/opensm/osm_lin_fwd_rcv.c
+++ b/opensm/opensm/osm_lin_fwd_rcv.c
@@ -70,7 +70,7 @@ void osm_lft_rcv_process(IN void *context, IN void *data)
 	CL_ASSERT(p_madw);
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
-	p_block = (uint8_t *) ib_smp_get_payload_ptr(p_smp);
+	p_block = ib_smp_get_payload_ptr(p_smp);
 	block_num = cl_ntoh32(p_smp->attr_mod);
 
 	/*
diff --git a/opensm/opensm/osm_mcast_fwd_rcv.c b/opensm/opensm/osm_mcast_fwd_rcv.c
index 635c7da..f3d0183 100644
--- a/opensm/opensm/osm_mcast_fwd_rcv.c
+++ b/opensm/opensm/osm_mcast_fwd_rcv.c
@@ -77,7 +77,7 @@ void osm_mft_rcv_process(IN void *context, IN void *data)
 	CL_ASSERT(p_madw);
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
-	p_block = (uint16_t *) ib_smp_get_payload_ptr(p_smp);
+	p_block = ib_smp_get_payload_ptr(p_smp);
 	block_num = cl_ntoh32(p_smp->attr_mod) & IB_MCAST_BLOCK_ID_MASK_HO;
 	position = (uint8_t) ((cl_ntoh32(p_smp->attr_mod) &
 			       IB_MCAST_POSITION_MASK_HO) >>
diff --git a/opensm/opensm/osm_node.c b/opensm/opensm/osm_node.c
index a97477a..ee2fbed 100644
--- a/opensm/opensm/osm_node.c
+++ b/opensm/opensm/osm_node.c
@@ -60,7 +60,7 @@ void osm_node_init_physp(IN osm_node_t * const p_node, uint8_t port_num,
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
 
-	p_ni = (ib_node_info_t *) ib_smp_get_payload_ptr(p_smp);
+	p_ni = ib_smp_get_payload_ptr(p_smp);
 	port_guid = p_ni->port_guid;
 
 	CL_ASSERT(port_num < p_node->physp_tbl_size);
@@ -82,7 +82,7 @@ osm_node_t *osm_node_new(IN const osm_madw_t * const p_madw)
 	uint32_t size;
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
-	p_ni = (ib_node_info_t *) ib_smp_get_payload_ptr(p_smp);
+	p_ni = ib_smp_get_payload_ptr(p_smp);
 
 	/*
 	   The node object already contains one physical port object.
diff --git a/opensm/opensm/osm_node_desc_rcv.c b/opensm/opensm/osm_node_desc_rcv.c
index f6178b9..a79fa22 100644
--- a/opensm/opensm/osm_node_desc_rcv.c
+++ b/opensm/opensm/osm_node_desc_rcv.c
@@ -106,7 +106,7 @@ void osm_nd_rcv_process(IN void *context, IN void *data)
 	CL_ASSERT(p_madw);
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
-	p_nd = (ib_node_desc_t *) ib_smp_get_payload_ptr(p_smp);
+	p_nd = ib_smp_get_payload_ptr(p_smp);
 
 	/*
 	   Acquire the node object and add the node description.
diff --git a/opensm/opensm/osm_node_info_rcv.c b/opensm/opensm/osm_node_info_rcv.c
index e40fc82..f5a5082 100644
--- a/opensm/opensm/osm_node_info_rcv.c
+++ b/opensm/opensm/osm_node_info_rcv.c
@@ -323,7 +323,7 @@ __osm_ni_rcv_get_node_desc(IN osm_sm_t * sm,
 	OSM_LOG_ENTER(sm->p_log);
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
-	p_ni = (ib_node_info_t *) ib_smp_get_payload_ptr(p_smp);
+	p_ni = ib_smp_get_payload_ptr(p_smp);
 	port_num = ib_node_info_get_local_port_num(p_ni);
 
 	/*
@@ -384,7 +384,7 @@ __osm_ni_rcv_process_existing_ca_or_router(IN osm_sm_t * sm,
 	OSM_LOG_ENTER(sm->p_log);
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
-	p_ni = (ib_node_info_t *) ib_smp_get_payload_ptr(p_smp);
+	p_ni = ib_smp_get_payload_ptr(p_smp);
 	port_num = ib_node_info_get_local_port_num(p_ni);
 	h_bind = osm_madw_get_bind_handle(p_madw);
 
@@ -573,7 +573,7 @@ __osm_ni_rcv_process_new(IN osm_sm_t * sm,
 	OSM_LOG_ENTER(sm->p_log);
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
-	p_ni = (ib_node_info_t *) ib_smp_get_payload_ptr(p_smp);
+	p_ni = ib_smp_get_payload_ptr(p_smp);
 	p_ni_context = osm_madw_get_ni_context_ptr(p_madw);
 	port_num = ib_node_info_get_local_port_num(p_ni);
 
@@ -719,7 +719,7 @@ __osm_ni_rcv_process_existing(IN osm_sm_t * sm,
 	OSM_LOG_ENTER(sm->p_log);
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
-	p_ni = (ib_node_info_t *) ib_smp_get_payload_ptr(p_smp);
+	p_ni = ib_smp_get_payload_ptr(p_smp);
 	p_ni_context = osm_madw_get_ni_context_ptr(p_madw);
 	port_num = ib_node_info_get_local_port_num(p_ni);
 
@@ -776,7 +776,7 @@ void osm_ni_rcv_process(IN void *context, IN void *data)
 	CL_ASSERT(p_madw);
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
-	p_ni = (ib_node_info_t *) ib_smp_get_payload_ptr(p_smp);
+	p_ni = ib_smp_get_payload_ptr(p_smp);
 
 	CL_ASSERT(p_smp->attr_id == IB_MAD_ATTR_NODE_INFO);
 
diff --git a/opensm/opensm/osm_pkey_rcv.c b/opensm/opensm/osm_pkey_rcv.c
index 7061941..84d8ce1 100644
--- a/opensm/opensm/osm_pkey_rcv.c
+++ b/opensm/opensm/osm_pkey_rcv.c
@@ -77,7 +77,7 @@ void osm_pkey_rcv_process(IN void *context, IN void *data)
 	p_smp = osm_madw_get_smp_ptr(p_madw);
 
 	p_context = osm_madw_get_pkey_context_ptr(p_madw);
-	p_pkey_tbl = (ib_pkey_table_t *) ib_smp_get_payload_ptr(p_smp);
+	p_pkey_tbl = ib_smp_get_payload_ptr(p_smp);
 
 	port_guid = p_context->port_guid;
 	node_guid = p_context->node_guid;
diff --git a/opensm/opensm/osm_port_info_rcv.c b/opensm/opensm/osm_port_info_rcv.c
index 654ede7..3e39dff 100644
--- a/opensm/opensm/osm_port_info_rcv.c
+++ b/opensm/opensm/osm_port_info_rcv.c
@@ -473,7 +473,7 @@ osm_pi_rcv_process_set(IN osm_sm_t * sm, IN osm_node_t * const p_node,
 	port_guid = osm_physp_get_port_guid(p_physp);
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
-	p_pi = (ib_port_info_t *) ib_smp_get_payload_ptr(p_smp);
+	p_pi = ib_smp_get_payload_ptr(p_smp);
 
 	/* check for error */
 	if (cl_ntoh16(p_smp->status) & 0x7fff) {
@@ -532,7 +532,7 @@ void osm_pi_rcv_process(IN void *context, IN void *data)
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
 	p_context = osm_madw_get_pi_context_ptr(p_madw);
-	p_pi = (ib_port_info_t *) ib_smp_get_payload_ptr(p_smp);
+	p_pi = ib_smp_get_payload_ptr(p_smp);
 
 	CL_ASSERT(p_smp->attr_id == IB_MAD_ATTR_PORT_INFO);
 
diff --git a/opensm/opensm/osm_slvl_map_rcv.c b/opensm/opensm/osm_slvl_map_rcv.c
index e177345..b3f0a4c 100644
--- a/opensm/opensm/osm_slvl_map_rcv.c
+++ b/opensm/opensm/osm_slvl_map_rcv.c
@@ -82,7 +82,7 @@ void osm_slvl_rcv_process(IN void *context, IN void *p_data)
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
 	p_context = osm_madw_get_slvl_context_ptr(p_madw);
-	p_slvl_tbl = (ib_slvl_table_t *) ib_smp_get_payload_ptr(p_smp);
+	p_slvl_tbl = ib_smp_get_payload_ptr(p_smp);
 
 	port_guid = p_context->port_guid;
 	node_guid = p_context->node_guid;
diff --git a/opensm/opensm/osm_sw_info_rcv.c b/opensm/opensm/osm_sw_info_rcv.c
index 2f2775a..14df1fd 100644
--- a/opensm/opensm/osm_sw_info_rcv.c
+++ b/opensm/opensm/osm_sw_info_rcv.c
@@ -208,7 +208,7 @@ static void si_rcv_process_new(IN osm_sm_t * sm, IN osm_node_t * const p_node,
 
 	p_sw_guid_tbl = &sm->p_subn->sw_guid_tbl;
 	p_smp = osm_madw_get_smp_ptr(p_madw);
-	p_si = (ib_switch_info_t *) ib_smp_get_payload_ptr(p_smp);
+	p_si = ib_smp_get_payload_ptr(p_smp);
 
 	osm_dump_switch_info(sm->p_log, p_si, OSM_LOG_DEBUG);
 
@@ -302,7 +302,7 @@ static boolean_t si_rcv_process_existing(IN osm_sm_t * sm,
 	CL_ASSERT(p_madw);
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
-	p_si = (ib_switch_info_t *) ib_smp_get_payload_ptr(p_smp);
+	p_si = ib_smp_get_payload_ptr(p_smp);
 	p_si_context = osm_madw_get_si_context_ptr(p_madw);
 
 	if (p_si_context->set_method) {
@@ -365,7 +365,7 @@ void osm_si_rcv_process(IN void *context, IN void *data)
 	CL_ASSERT(p_madw);
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
-	p_si = (ib_switch_info_t *) ib_smp_get_payload_ptr(p_smp);
+	p_si = ib_smp_get_payload_ptr(p_smp);
 	p_context = osm_madw_get_si_context_ptr(p_madw);
 	node_guid = p_context->node_guid;
 
diff --git a/opensm/opensm/osm_switch.c b/opensm/opensm/osm_switch.c
index 9807791..6dde47c 100644
--- a/opensm/opensm/osm_switch.c
+++ b/opensm/opensm/osm_switch.c
@@ -87,7 +87,7 @@ osm_switch_init(IN osm_switch_t * const p_sw,
 	uint32_t port_num;
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
-	p_si = (ib_switch_info_t *) ib_smp_get_payload_ptr(p_smp);
+	p_si = ib_smp_get_payload_ptr(p_smp);
 	num_ports = osm_node_get_num_physp(p_node);
 
 	CL_ASSERT(p_smp->attr_id == IB_MAD_ATTR_SWITCH_INFO);
diff --git a/opensm/opensm/osm_vl_arb_rcv.c b/opensm/opensm/osm_vl_arb_rcv.c
index ec04d67..89cf7b2 100644
--- a/opensm/opensm/osm_vl_arb_rcv.c
+++ b/opensm/opensm/osm_vl_arb_rcv.c
@@ -83,7 +83,7 @@ void osm_vla_rcv_process(IN void *context, IN void *data)
 	p_smp = osm_madw_get_smp_ptr(p_madw);
 
 	p_context = osm_madw_get_vla_context_ptr(p_madw);
-	p_vla_tbl = (ib_vl_arb_table_t *) ib_smp_get_payload_ptr(p_smp);
+	p_vla_tbl = ib_smp_get_payload_ptr(p_smp);
 
 	port_guid = p_context->port_guid;
 	node_guid = p_context->node_guid;
-- 
1.6.1.2.319.gbd9e




More information about the general mailing list