[ofw] [PATCH] mthca patch [1/2]

Reuven Amitai reuven at mellanox.co.il
Wed Apr 9 06:03:32 PDT 2008


Hi,
 
The following patch align the returned address.
 
Thanks, Reuven.
 

Index: inc/mthca/mthca_vc.h

===================================================================

--- inc/mthca/mthca_vc.h      (revision 1047)

+++ inc/mthca/mthca_vc.h      (working copy)

@@ -78,12 +78,18 @@

 

 inline char* mthca_get_board_id(ib_ca_attr_t *ca_attr)

 {

-    return (char*)(ca_attr)+(ca_attr->size - MTHCA_BRD_ID_LEN -
sizeof(uplink_info_t));

+     int size = (ca_attr->size - MTHCA_BRD_ID_LEN -
sizeof(uplink_info_t));

+     size &= ~(sizeof(void*) - 1);

+     

+     return (char*)(ca_attr)+ size;

 }

 

 inline void* mthca_get_uplink_info(ib_ca_attr_t *ca_attr)

 {

-    return (char*)(ca_attr)+(ca_attr->size - sizeof(uplink_info_t));

+     int size = (ca_attr->size - sizeof(uplink_info_t));

+     size &= ~(sizeof(void*) - 1);

+

+     return (char*)(ca_attr)+ size;

 }

 

 #endif

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080409/078fa128/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mthca_vc.patch
Type: application/octet-stream
Size: 764 bytes
Desc: mthca_vc.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080409/078fa128/attachment.obj>


More information about the ofw mailing list