[ofa-general] [PATCH] libibmad: use mad_set_field64() for mkey encoding

Sasha Khapyorsky sashak at voltaire.com
Wed Jan 21 17:24:46 PST 2009


Use mad_set_field64() for 64-bit mkey encoding.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 libibmad/src/mad.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/libibmad/src/mad.c b/libibmad/src/mad.c
index d059a70..3f04da0 100644
--- a/libibmad/src/mad.c
+++ b/libibmad/src/mad.c
@@ -96,9 +96,7 @@ void *mad_encode(void *buf, ib_rpc_t * rpc, ib_dr_path_t * drpath, void *data)
 	mad_set_field(buf, 0, IB_MAD_ATTRMOD_F, rpc->attr.mod);
 
 	/* words 7,8 */
-	mad_set_field(buf, 0, IB_MAD_MKEY_F, (uint32_t) (rpc->mkey >> 32));
-	mad_set_field(buf, 4, IB_MAD_MKEY_F,
-		      (uint32_t) (rpc->mkey & 0xffffffff));
+	mad_set_field64(buf, 0, IB_MAD_MKEY_F, rpc->mkey);
 
 	if (rpc->mgtclass == IB_SMI_DIRECT_CLASS) {
 		/* word 9 */
-- 
1.6.0.4.766.g6fc4a




More information about the general mailing list